5 replies
by sl-campbell
1. The DateSerial accepts the input of Year,Month,Date as in DateValue(2002,2,20)
2. You can change a string to a date using the CDate function: CDate(myDate) where myDate="02/20/2002"
2. You can also ?se the DateValue function: DateValue(myDate)
by lh
by hmertens
Try reproducing the error under OL2000/VBA in debug mode (immediate window) mode and couldn't, e.g.
?vba.DateSerial("2002","02","31")
and
x="2002"
y="2"
z="31"
?vba.DateSerial(x,y,z)
What version of VBA are you using (I using 6.0.8714with OL2K)?
As a coding solution using my second approach above, you could try this:
x="2002"
y="2"
z="31"
?vba.DateSerial(vba.CInt(x),vba.CInt(y),vba.CInt(z))
NB: This should return a date of 03/03/2002 (March 3rd...)
by lh
by lh
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending