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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking dates wether they are previous or posta current date

Status
Not open for further replies.

autoIT

IS-IT--Management
May 10, 2006
68
0
0
US
I want to take a current date and check it against existing entry dates. For integers you can say if x>y or if x<y, does the same logic work for dates.

example
var1=03/01/07 var2=04/01/07

if var2>var3 then......meaning if var1 comes after var2


is this right?
 
Why dony you try it?

Remember to add Date delimiters
var1=#03/01/07#
 
so by adding #date# will compare one date against another to see which one is the most recent?


Adam
 
here is a better example of what i mean

If rs.Fields.Item("Pay Period") > TempDate Then

i am not using the dates per say, the date is in avariable in this case the variable is tempdate. I wouldn't put #tempdate#, would i?
 
On this line you dont need date delimiters
, but how did you assign a value to tempdate
 



Hi,

A STRING is not a DATE. A Real Date is a NUMBER, like today, in the MS world is 39160.

The ## delimiters force a String to Date conversion base on year, month, day formatting rules.

To be absolutely certain that month and day will be interpreted as expected, it is best to use a yyyy/mm/dd STRING format rather than the American or British formats that lead with month or day respecitvely.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top