Returning Dates

J

JDL

How can I return a date from an IIf statement.

IIf([something]=1, "01/01/2002", [somethingelse])

I'm using this in a query on a date field. It does not seem to work when I use a real date like I have shown above.

Thanks
 
D

Dale Fye

Try: IIf([something]=1, #01/01/2002#, [somethingelse])

OR: IIf([something]=1, Cdate("01/01/2002"), [somethingelse])



--
HTH

Dale Fye


How can I return a date from an IIf statement.

IIf([something]=1, "01/01/2002", [somethingelse])

I'm using this in a query on a date field. It does not seem to work
when I use a real date like I have shown above.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top