Lotusscript Version Of Vb's Date_Add

Created this function to simulate the VB version.
Function Date_Add(Byval aDatePart$, Byval aLength%, Byval aDate)
'The same as the Date_Add command from VB
Dim aDat, aYear%, aMonth%, aDay%
aYear% = Year(aDate)
aMonth% = Month(aDate)
aDay% = Day(aDate)
Select Case Ucase(Trim(aDatePart$))
Case "Y": aDat = Datenumber(aYear% + aLength%, aMonth%, aDay%)
Case "M": aDat = Datenumber(aYear%, aMonth% + aLength%, aDay%)
Case "D": aDat = Datenumber(aYear%, aMonth%, aDay% + aLength%)
Case "W": aDat = Datenumber(aYear% + aLength%, aMonth%, aDay% + (aLength%
* 7))
End Select
Date_Add = aDat
End Function

This was first published in November 2000
This Content Component encountered an error



Forgot Password?

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

Your password has been sent to:




  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...