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

Dates Comparison

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
0
0
CA
Hi,

I am having difficulties comparins the dates.

Here is what I do and it does not work:

If doc.PLAN_INSTL_DATE(0) < 11/01/2001 Then
'do something
Else


Even if doc.PLAN_INSTL_DATE is before 11/01/2001, script jumps to the ELSE condition.

Please help.


 
Is your field PLAN_INSTL_DATE a NotesDateTime field?

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
The best way to compare dates in LScript is to use NotesDateTime objects.

try the following code :

Code:
dim docdate as notesdatetime
dim checkdate as notesdatetime

set checkdate = new notesdatetime(&quot;11/01/2001&quot;)
set docdate = new notesdatetime(doc.PLAN_INSTL_DATE(0))
If docdate.dateonly < checkdate.dateonly Then
            'do something
 Else

This should help you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top