Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 12890

Validating different DATE FORMATs

$
0
0

Hi Friends...

I get in trouble again, I have different flat files with a DATE column in string format, but, the problem is that each file has a different DATE FORMAT in that column, for example:  yyyy/mm/dd , yyyy/dd/mm , dd/mm/yyyy , mm/dd/yyyy  . . . and i need to put these data in a table without changing the original DATE. Today is 2014/08/03 or August 3rd 2014, i need to write this data in the table without changing it to 2014/03/08 or March 8th 2014.

Can you give me any idea to solve this problem ?

I have one, but im not sure if it is the best option, while the DTSx is uploading the data to the stage table, it tries to identify what is the DATE FORMAT using a script and using the first two rows, because the 1st row containt the day 1 and the second row the day 2, always, its sorted by date.

Thanks in advance, regards !


Sergio Sánchez Arias
Oaxaca,México
AYÚDANOS A AYUDARTE



Viewing all articles
Browse latest Browse all 12890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>