How to compare dates? Help

Hi…

I am trying to create a lotusScript agent that will retreive all the documents from a view and compare dates to put a flag to either "1" or "0". my problem occures when I try to check that now >= doc.date1 & now <= doc.date2 . What is the proper way to verify that the current date is within the start and end dates of the document?

Thanks, Bryce!

Subject: how to compare dates? Help…

Use the NotesDateTime class.

Method TimeDifference.

Subject: how to compare dates? Help…

Set hdItem=doc.Getfirstitem(“Date1”)Set hddatetime=hdItem.DateTimeValue

Set hdItem2=doc.Getfirstitem(“Date2”)

Set hddatetime2=hdItem2.DateTimeValue

Set DateTime = New NotesDateTime( “Today” )

x= DateTime.TimeDifference(hdDateTime )/(86400*365)

y= DateTime.TimeDifference(hdDateTime2 )/(86400*365)

if x > 0 and y < 0 then…

Is that helpful?

Subject: how to compare dates? Help…

At the very least:

now >= doc.date1(0)