Click here to Skip to main content
13,357,514 members (69,564 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I am getting some files from third party server .
In this file Date is coming like this -


I mean to say some time 6 digit some 8 digit,How we convert it in valid date or date time format.
Posted 20-Sep-12 20:59pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100