IIf statement in query criteria

Kinger43

racecar driver
Local time
Today, 04:05
Joined
Aug 17, 2007
Messages
226
Is there a problem with using an IIf statement in the criteria of a query. If ther isn't then is there a problem with using a Between...And statement inside the IIf statement. Or, does anybody see a problem with this IIf statement being in the criteria of a query.

IIf([blinks_test_end].[Blinks]<>[blinks_test_start].[Blinks],([daily_extract].[Reading_Date]) Between [blinks_test_start]![Reading_Date] And [blinks_test_end]![Reading_date],Null)

[blinks_test_end] and [blinks_test_start] are queries that use the table [daily_extract] the query that I am trying to run uses these queries and the table, however, I have nothing joined. The IIf statement is in the criteria of the [daily_extract].[Reading_Date] field.
 
in order to use the IIF as a criteria in a query where multiple queries/tables are involved, they must either be queries/tables that return/contain single records OR must be joined in an way that the fields exactly line up. There can be no ambiguity in the IIf clause.
 

Users who are viewing this thread

Back
Top Bottom