How can i compare 2 Dates

Fontanus

Member
Licensed User
How can I compare two date values? I would like to determine and store the greatest value.
 

Cableguy

Expert
Licensed User
Longtime User
Hi,

First You have to convert the date back to ticks:

T = DateParse ("01/30/2012")

Then compare both results, the newer date will be the greater
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
You first need to convert to the tick value of the date and then determine which is greater. See quote of B4PCC help file below.

Returns the ticks value of a date string.
The date string must be formatted exactly as the date format. (Default "mm/dd/yyyy")
Syntax: DateParse (Date String)
Example:
T = DateParse ("01/30/2012")

Looks like CableGuy got in first ;-p

Regards,
RandomCoder
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…