Click to See Complete Forum and Search --> : compare date in vb?


George
February 4th, 1999, 05:44 PM
Hi: there

How can I compare date in vb?

I only compare date not time, it's really trouble that I have to format

long time to date, but I can't comare two string?


any ideal?


thanks


George

Chris Eastwood
February 8th, 1999, 02:59 AM
Hi


You want to take a look at the DateDiff function in VB. This can be used to give you the specified period between two dates (in either days, weeks, months, quarters, years, minutes, hours etc).


This way you wont have to change your dates to strings to compare them. Obviously with the DateDiff function, if the result is '0' then both dates are identical.


Regards


Chris Eastwood


CodeGuru - the website for developers

http://www.codeguru.com