I have a view of documents with a date-time field. Now the customer
wants to enter a start date and a end-date. All the documents with the
mentioned date-time field which fits in the entered date-range will be
exported to somewhere.
Now. I solved the problem with getting the String value of the field
via
--------------------
strInputDateMax = Inputbox$("Enter a Date")
InputDateMax = Cdat (strInputDate)
strDocDate = doc.dateValue (0)
docDate = Cdat (doc.dateValue(0))
if docDate <= InputDateMax then
DoSomething
end if
-----------------------
Aren´t there any better solutions for comparing dates with LotusScript
in LotusNotes???
Sent via Deja.com http://www.deja.com/
Before you buy.
You can use the NotesDateTime or NotesDateRange items. Doesn't really make
anything any simpler though.
Regards
Rick
axel <a...@kasten.de> wrote in message news:8qvlre$49t$1...@nnrp1.deja.com...
>Hello everybody,
>
>I have a view of documents with a date-time field. Now the customer
>wants to enter a start date and a end-date. All the documents with the
>mentioned date-time field which fits in the entered date-range will be
>exported to somewhere.
>
>Now. I solved the problem with getting the String value of the field
>via
>--------------------
>strInputDateMax = Inputbox$("Enter a Date")
>InputDateMax = Cdat (strInputDate)
>
>strDocDate = doc.dateValue (0)
>docDate = Cdat (doc.dateValue(0))
>
>if docDate <= InputDateMax then
> DoSomething
> end if
>-----------------------
>
>Aren´t there any better solutions for comparing dates with LotusScript
>in LotusNotes???
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Create a LotusScript procedure to do a NotesDatabase.Search and build
the criteria string like you would for a notes view:
Criteria = "SELECT Form = "MyForm" & MyDateField >= [startdate] &
MyDateField <= [enddate]"
set docCollection = db.Search(Criteria,MyNotesDateTimeObj,0)
set MyDoc = docCollection.GetFirstDocument
do until MyDoc is nothing
[do something with doc]
set MyDoc = docCollection.GetNextDocument
loop
Note: You must build the criteria string EXACTLY as it would appear in
a notes view i.e. include the quotation marks, brackets, etc.
Wade Anderson
American General