hcl-bot
October 16, 2007, 12:00am
1
Dim dtDoj As NotesDateTimedim ndocforDOJ As NotesDocument
'dtDOJ is datetime field
Set dtDoj = New NotesDateTime(ndocforDOJ.dtDOJ(0))
Msgbox “Date=>” & dtDoj.DateOnly 'No error
Msgbox “” & Cstr(Month(dtDoj.DateOnly))'type misnatch error
Msgbox “” & Cstr(Year(dtDoj.DateOnly))'type misnatch error
hcl-bot
October 16, 2007, 12:36am
2
Subject: Notesdatetime type mismatch
The DateOnly property returns a String, note a Date. You can’t take the Month of a String.
hcl-bot
October 16, 2007, 12:48am
3
Subject: RE: Notesdatetime type mismatch
Dim dtDoj As NotesDateTimedim ndocforDOJ As NotesDocument
'dtDOJ is datetime field
Set dtDoj = New NotesDateTime(ndocforDOJ.dtDOJ(0))
Msgbox “Date=>” & dtDoj.DateOnly 'No error
Msgbox “” & Cstr(Month(cdat(dtDoj.DateOnly)))’ type mismatch error
Msgbox “” & Cstr(Year(cdat(dtDoj.DateOnly)))’ type mismatch error
Still giving same problem … any other way of getting month of date
Since dtDoj is datetime field
Month(ndocforDOJ.dtDOJ(0)) is working fine , but want to know the reason why it is not working with notesdatetime
hcl-bot
October 16, 2007, 12:58am
4
Subject: RE: Notesdatetime type mismatch
Why all the casting? There’s a method to get a Date variant from a NotesDateTime object – LSLocalTime. If you want to force the NotesDateTime object to a date-only (no time) value, use the SetAnyTime method.