Returning Dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top