Click here to Skip to main content
15,879,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting some files from third party server .
In this file Date is coming like this -

20300101
209912
201209
20200209

I mean to say some time 6 digit some 8 digit,How we convert it in valid date or date time format.
Posted

1 solution

Hi,
For 8 digit like '20120921' it is possible to convert.
select convert(date,'20120921',103)


for six digit u need to append '01' to form a valid date and then convert it in same fashion.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900