Sending a Lotus Notes Agent 2 days before today using LotusScript

1142290 pts.
Tags:
lotus notes agent
LotusScript
I'm wondering if somebody can help me with the following scenario: I'm creating a Lotus Notes Agent which will send late in notification for two days (before today) with Sunday a non-working day. So in that case if today was Monday, the Agent will send late attendance for last Friday. Tuesday would send last Saturday. I've figured out how to get today's date but how can I get two days before day? Here's what I got so far:
Dim tdy, dayToUse
Dim intl As NotesInternational
Set intl = ss.International
tdy=intl.Today
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Well, part of the problem is that Intl.Today produces a string, not a date.  It would probably be easier to do something like this (I haven’t tested this) using whatever format code you want:

Dim ndt As NotesDateTime

Dim priorday As NotesDateTime

Dim tdy As String

Dim dayToUse As String

Set ndt = Now()

tdy = Format( ndt, “Short Date” )

Set priorday = Now()

Call priorday.AdjustDay( -2 )

dayToUse = Format( priorday, “Short Date” )

 

This doesn’t allow for the missing Sundays, but you can use an if statement and a different AdjustDay call to compensate for that.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: