Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert from char to datetime
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00974367
Message ID:
00974386
Views:
17
Daniel
Try:
lcDateStr = '20041223' 
ldDateTime = CTOT( SUBSTR( lcDateStr, 5, 2) + "/" + RIGHT( lcDateStr, 2) + "/" + LEFT( lcDateStr, 4))
Terry

>Hi All,
>
>Can anyone help me with the conversion of '20041223' string to datetime data type in the following format 12/31/2004 ?
>
>TIA,
>Daniel M.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform