Date comparison in a query

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

Hi, i am trying to compare too dates. e.g.
Expr1: IIf([AlDate]>3/5/2004,"Red","Green")

If the AlDate is more than 03/05/2004 it must be red
e.g. 06/05/2004 should be red and 02/05/2004 should be
green.

This is not working, i am sure it is just a method
problem, could somebody please help?
 
You are a star, works great thanks...;-)
-----Original Message-----
Did you try #3/5/2004#? I think you need those #'s for
date comparisons.

-----Original Message-----
Hi, i am trying to compare too dates. e.g.
Expr1: IIf([AlDate]>3/5/2004,"Red","Green")

If the AlDate is more than 03/05/2004 it must be red
e.g. 06/05/2004 should be red and 02/05/2004 should be
green.

This is not working, i am sure it is just a method
problem, could somebody please help?

.
.
 
If [AlDate] is datatype datetime, it should read

IIf([AlDate]>#3/5/2004#,"Red","Green")

note the "#

----- Les wrote: ----

Hi, i am trying to compare too dates. e.g
Expr1: IIf([AlDate]>3/5/2004,"Red","Green"

If the AlDate is more than 03/05/2004 it must be red
e.g. 06/05/2004 should be red and 02/05/2004 should be
green

This is not working, i am sure it is just a method
problem, could somebody please help
 
Back
Top