Compare dates

H

Hans

Hello

I like to know how I can compare 2 dates.

I have tried:

If startDate < FinishDate then...

Else if startDate > FinishDate then...

End if

but this give me ex. that 12/06/04 is greater than (come after) 01/23/05.

Can someone tells me the right way to compare two dates.

Thanx

Hans
 
J

JackD

It should not give you that result.

Try using datevalue(yourdate)

Note that if the year part of date is omitted, DateValue uses the current
year from your computer's system date.
What is your setting for dates in Project? If it doesn't include the year,
then this problem could creep in.

-Jack
 
H

Hans

Hi Jack
Try using datevalue(yourdate)

I tried with Datevalue(mydate) and it works.
Note that if the year part of date is omitted, DateValue uses the current
year from your computer's system date.
What is your setting for dates in Project? If it doesn't include the year,
then this problem could creep in.

In Project I have m/d/yy format but in my computer I have m/d/yyyy,
but it still work.

Thanx
Hans
 
J

JackD

Glad to hear you got it working.

-Jack

Hans said:
Hi Jack


I tried with Datevalue(mydate) and it works.


In Project I have m/d/yy format but in my computer I have m/d/yyyy,
but it still work.

Thanx
Hans
 

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