i can have:
mystring="08012021"
...
mystring="11032022"
how to return:
mydate=8/01/2021
...
mydate=11/03/2023
note:
mystring as string
mydate as date
STRING TO DATE
-
- Administrator
- Posts: 78393
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: STRING TO DATE
Code: Select all
mydate = DateSerial(Right(mystring, 4), Mid(mystring, 3, 2), Left(mystring, 2))
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4343
- Joined: 26 Apr 2010, 17:36
Re: STRING TO DATE
Tks.HansV wrote: ↑28 Apr 2021, 15:53Code: Select all
mydate = DateSerial(Right(mystring, 4), Mid(mystring, 3, 2), Left(mystring, 2))
Work