Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare dates

Status
Not open for further replies.

wafabekhti

Programmer
Dec 22, 2003
3
US
How do I compare 2 dates (mm/dd/yy) to let the user know which one is dated earlier.
when I used
if date1 < date2 then
do this
it is comparing the months only.
 
What data type are the variables 'date1' and 'date2'?

If they are date types then your code should work. If they are strings try,

Code:
If CDate(date1) < CDate(Date2) then...

Take Care,

zemp

&quot;If the grass looks greener... it's probably because there is more manure.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top