J
John Marshall, MVP
How do I convert an eight character string in the form YYYYMMDD to a date?
John... Visio MVP
John... Visio MVP
How do I convert an eight character string in the form YYYYMMDD to a date?
John... Visio MVP
John Vinson said:How do I convert an eight character string in the form YYYYMMDD to a date?
John... Visio MVP
You need to insert the slashes:
DateValue(Left([textdate], 4) & "/" & Mid([textdate], 5, 2) & "/" &
Right([textdate], 2))
PC Datasheet said:Dim StrYear As String
Dim StrMonth As String
Dim StrDay As String
StrYear = Left([EightChrString],4)
StrMonth = Mid([EightChrString,5,2)
StrDay = Right([EightChrString],2)
MyDate = DateSerial(CInt(StrYear),CInt(StrMonth),CInt(StrDay))
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
John Marshall said:How do I convert an eight character string in the form YYYYMMDD to a date?
John... Visio MVP
Thanks John, but how do indicate that it is ymd rather than ydm?
I doubt ydm is used, but there is confusion with dmy and mdy.