IIF Criteria Help Needed

GendoPose

Registered User.
Local time
Today, 21:02
Joined
Nov 18, 2013
Messages
175
Hi All,

In my query, I have the following criteria;

Code:
IIf([MAIL DATE]<Date() And [COMPLETED]=False,[MAIL DATE]<Date(),[MAIL DATE] Between Date() And (Date()+1))

However, this brings up no results.

I just want it to look at all the records and find the ones that aren't completed before today, bring them up and then also show all the records that are for today and tomorrow.

Any ideas at all?

Thanks!
 
You are not using that in the Criteria of the Query are you?
 
For a pre compiled query you cannot do this. In VBA yes, but not in the Query builder.
 
Ummm.. Use VBA? Show the complete Query if you want help converting this to VBA.
 
Ummm.. Use VBA? Show the complete Query if you want help converting this to VBA.

Code:
SELECT [MASTER PLANNER].*, [MASTER PLANNER].[MAIL DATE]
FROM [MASTER PLANNER]
WHERE ((([MASTER PLANNER].[MAIL DATE])=IIf([MAIL DATE]<Date() And [COMPLETED]=False,[MAIL DATE]<Date(),[MAIL DATE] Between Date() And (Date()+1))));

That's the complete SQL with the criteria in.
 
Looks like Paul's tied up, so here.
In a field of the query:
Code:
[COLOR="Blue"]Expr1[/COLOR]: IIf([MAIL DATE]<Date() And [COMPLETED]=False OR [MAIL DATE] Between Date() And (Date()+1), Null, 0)
Under the criteria of this field:
Code:
Is Null

Edit: I suppose he wasn't. I was just slow to refresh the page ;)
 
Looks like Paul's tied up, so here.
In a field of the query:
Code:
[COLOR=blue]Expr1[/COLOR]: IIf([MAIL DATE]<Date() And [COMPLETED]=False OR [MAIL DATE] Between Date() And (Date()+1), Null, 0)
Under the criteria of this field:
Code:
Is Null

Edit: I suppose he wasn't. I was just slow to refresh the page ;)

Hah no worries, this has got it perfectly! Thank you both for your help!
 

Users who are viewing this thread

Back
Top Bottom