Extract a clean date value from multiple date field types.

The code below will take any date field format and convert it to a clean date only string. For example, the following dates will result in "01/01/2001" 01/01/2001 or 01/01/2001 7:00PM or January 1, 2001 or 2001/1/1 . You will need to dim and set the Doc1.
LotusScript


Dim Doc1 as NotesDocument
Dim DateV as Variant
Dim EffectiveDate as String

If Not doc1.BaseSalaryEffectiveDate(0) = "" Then
        DateV = Datevalue(doc1.BaseSalaryEffectiveDate(0))
        EffectiveDate = Cstr(Cdat(DateV))
End If

Posted by fbrefere001 on Thursday December 20, 2001