Bonediggler1
Technical User
Hi-
I am using CDate in conjunction with the format property to turn a string ("07/01/2008") into a date and then subtract one day (i.e. the result should be "06/30/2008"). However, when doing this the zero associated with June ("06") is deleted, even when specifying the "mm/dd/yyyy" format. The relevant code is below:
Dim strFileDate As String
Dim strFileDateA As Date
strFileDateA = Format((CDate(strFileDate) - 1), "mm/dd/yyyy")
Where strFileDate = "07/01/2008". The result is "6/30/2008".
Thank you!!
I am using CDate in conjunction with the format property to turn a string ("07/01/2008") into a date and then subtract one day (i.e. the result should be "06/30/2008"). However, when doing this the zero associated with June ("06") is deleted, even when specifying the "mm/dd/yyyy" format. The relevant code is below:
Dim strFileDate As String
Dim strFileDateA As Date
strFileDateA = Format((CDate(strFileDate) - 1), "mm/dd/yyyy")
Where strFileDate = "07/01/2008". The result is "6/30/2008".
Thank you!!