Comparing dates with script

Hi,

I am having a problem comparing dates, the code is bellow…

StartDate = tempdoc.StartDateSearch ‘ the date is 2006-03-03

EndDate = tempdoc.EndDateSearch ‘the date is 2008-12-12

While Not(doc Is Nothing)

Dim ExpiryDate As NotesDateTime 

Set ExpiryDate = New NotesDateTime (doc.RoadTrainingDate(0))

Call ExpiryDate.AdjustYear( 5 ) ‘ adjusting 5 years taler

NewDate =  ExpiryDate.localtime ‘ this is 2006-11-11



If NewDate >= StartDate(0) And  NewDate <= EndDate(0) Then

…

…

…

If I do If NewDate <= StartDate(0) ‘ that works fine but when I test the EndDate if does not work… yet the NewDate is 2006-11-11 and the EndDate is 2008-12-12

2006-11-11 <= 2008-12-12

What am I doing wrong here….

thanks

P.

Subject: Comparing dates with script

how are the variables StartDate and EndDate dimmed ? Shouldn’t it be like:

StartDate = tempdoc.StartDateSearch(0) ‘ the date is 2006-03-03

EndDate = tempdoc.EndDateSearch(0) ‘the date is 2008-12-12