SQL Satement Wont Execute

shamas21

Registered User.
Local time
Today, 22:59
Joined
May 27, 2008
Messages
162
Hi All

I have the following SQL statement that will not execute.

Can i get someones take on this.

Code:
SELECT qrysearch.*
FROM qrysearch
WHERE IIf(IsNull(Forms!Search!tbxDate),[monthly report] Like '*',IIf(Forms!Search!cbxOptionDate="Equals",CDate([Reporting_Year] & "/" & [Monthly Report] & "/01") =Forms!Search!tbxDate));

Thanks
 
This could be a number of things. Do you get some kind of error message that could narrow things down a little?
 
The Standard Format for the IIf Command is something like this:

IIf (TestQuery, ValueifTRUE, ValueifFalse)

Your Format seems to break down to:

IIf (TestQuery, ConditionifTRUE, ConditionifFalse)

for the first IIf and

IIf (TestQuery, ValueifTRUE)

for the second IIf

I have never seen the first IIf format the you used, so I cannot comment on it.

I have heard of the second IIf format, and I believe it does work, although I have never used it myself
 

Users who are viewing this thread

Back
Top Bottom