Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

compare dates with LotusScript

908 views
Skip to first unread message

axel

unread,
Sep 28, 2000, 3:00:00 AM9/28/00
to
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.

Rick Clark

unread,
Sep 28, 2000, 3:00:00 AM9/28/00
to
Hi Axel

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...

ma...@nospam.newclique.com

unread,
Sep 29, 2000, 12:40:34 AM9/29/00
to
On Thu, 28 Sep 2000 14:50:26 GMT, axel <a...@kasten.de> wrote:

>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

0 new messages