Date - cont

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

Guest

I am sorry, it ha been sent by mistake.

So, I wrote the following condition:
If [eventDate] >= #1/9/2005# Then

[insuranceyear] = 6
else
[insuranceyear] = 5
end if

I don't know why, when I enter 01/05/2005, in the condition, it shows that
it is bigger then 01/09/2005. (it brings TRUE).

Any idea why?

Thanks a lot,
Liat
 
Liat said:
I am sorry, it ha been sent by mistake.

So, I wrote the following condition:
If [eventDate] >= #1/9/2005# Then

[insuranceyear] = 6
else
[insuranceyear] = 5
end if

I don't know why, when I enter 01/05/2005, in the condition, it shows that
it is bigger then 01/09/2005. (it brings TRUE).

Any idea why?

Thanks a lot,
Liat

The date expression #1/9/2005# is being interpreted as a US-format date i.e.
9th January. There are several ways of getting around this, such as this:

If [eventDate] >= Cdate("01/9/2005")
 
Beware that #1/9/2005# is interpreted as Jan 09, 2005 according to US-format
while when you enter "01/05/2005" in your UK format, this will be
interpreted as 1 May 2005 which is later than Jan 09, 2005.
 
Back
Top