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

Comparing Dates

Status
Not open for further replies.

ma701sd

IS-IT--Management
Dec 15, 2000
94
GB
Hi,

A quick Question, I want to perform a date compare but im unsure of how to go about it.
I have a variable called "lastvisit". I want to compare this value against todays date.
If the user has visited before (based on "lastvisit") then do something
else if the user has not visited before then do somethingelse.

Any suggestions will be greatly appreciated

Thanx
S...
 
You will want the DatePart() and DateCompare() functions.

A couple of working scripts to get you started:

DateCompare()

DatePart()

Of course, if you are doing this whithin an SQL statement it is easier yet. Simply use the < operator as in:

Where LastVisit < #CreateODBCDate(Now())#
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top