Help with IIf function in criteria

mrkipling

Registered User.
Local time
Today, 20:44
Joined
Mar 19, 2003
Messages
22
I have the following IIF function in the criteria of a date field.

IIf(Weekday(Now())=6,Between Now()-2 And Now()-10)

I want to return dates between 2 and 10 days ago, if today is Friday, but this doesnt return any values at all.

Is the statement above correct ?

TIA.

Mark
 
You can't build criteria like that in SQL. You can either use VBA code to assemble a string that you can run as SQL, or you can use text boxes in a form to calculate the values you want and use the text boxes as your criteria.
 
Thanks for the reply neileg, can you explain a little more as to how assemble a sql string in vba that would achieve this ?
 
Ignore last post, managed to work it out for myself - just being slack. Thanks again
 

Users who are viewing this thread

Back
Top Bottom