Date compare problem

RomeoJuliet

Registered User.
Local time
Today, 23:33
Joined
Nov 20, 2008
Messages
23
I have a date field [orderDate] on a form, and a calculated text box with control source:
Code:
=IIf([orderdate]>"30/04/2009",2,1)
... the idea being that the box will display 1 for order dates up to 30th Apr 2009, and thereafter a 2.

Why is it 1 whatever date I enter?

Thanks
Mike.
 
Try

=IIf([orderdate]>#30/04/2009#,2,1)
 
Hmmm, Thought I had tried that but obviously not because it worked. Thank you!

Mike.
 
No problem Mike. Quotes would be appropriate for a text value, but dates require the octothorp/hash/pound sign/number sign/whatever-you-want-to-call-it.
 

Users who are viewing this thread

Back
Top Bottom