How to work with date-fileds in Domino

As a newbie I’m struggeling with date fields in my LS. I’ve defined a date-filed in a Form and I retrieve the content of this Field with date_input = uidocCur.FieldGetText(“einddatum”), where I Dim-ed date_input as Variant. It seems that LS treats the date_input as String. If I compare dates with date_input, I don’t get the wanted results. How should I declare and retrieve dates from a form in order to work correctly with them?Thanks in advance

Subject: Do not work with the NotesUIDocument class…

As you have observed it is all text there. Use the backend NotesDocument class i.e.dim d as NotesDocument

set d = uidoc.Document

'then you can refer to the date field in any of the following fashions they all return an LS Date/Time

datevalArray = doc.GetItemValue(“DateField”)

datevalArray = doc.DateField 'Extended syntax

dateval = doc.DateField(0) 'Extended syntax

Subject: RE: Do not work with the NotesUIDocument class…

Thanks Bill. Just to be sure. I used the NotesUIDocument class for I want to check an entered date against some dates in other doc’s in the same db. I thought I should use NotesUIDocument to access my current document. Furthermore I use the NotesDocument class to retrieve the documents in the database that are to be checked against the current doc. Can I also use NotesDocument for my current document?

Subject: Sure, the following lines do that

dim w as new NotesUIWorkspace

dim uidoc as NotesUIDocument

dim d as NotesDocument

set uidoc = w.CurrentDocument

set d = uidoc.Document

Subject: how to work with date-fileds in Domino

Use the notes date time class.

Dim variableName As New NotesDateTime(uidocCur.FieldGetText(“einddatum”)

Then there are a number of methods and properties to work with.