Comparison of date fields

Hi ,I have 2 date fields Date1 and Date2.

They are both in MYY format i.e., a single byte month and 2 byte year.

The month values are ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ ‘6’ ‘7’ ‘8’ ‘9’ ‘0’ ‘-’ ‘&’ i.e., Month is alphanumeric and Oct, Nov and Dec are assigned with ‘0’, ‘-’ and ‘&’ respectively.

I have to compare if date1>date2.

The only logic that comes to my mind is regenerating 2 byte month from single byte month and assign century to year field. But this requires lot of variables in addition to the input file variables. Also lot of IF is used.

Can you help me in optimising the comparison?

How can I go about comparing this kind of dates?

pls help…

Subject: comparison of date fields

Hi Tulsi,

This is the sample code i hope this helps

Dim ss As New NotesSession

Dim db As NotesDatabase

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim dt1 As NotesDateTime

Dim dt2 As NotesDateTime

Set db=ss.CurrentDatabase

Set uidoc = workspace.CurrentDocument

Set doc=uidoc.Document



Set dt1= New NotesDateTime(doc.date1(0))

Set dt2= New NotesDateTime(doc.date2(0))

diff&=dt1.TimeDifference(dt2)

If diff& > 0 Then

	Msgbox "date1 should not greater than date2"

End If

Cheers

RAJ