July 25, 2016 at 2:05 pm
I am trying to pull date format yyyy-mm-dd hh.mm.ss from '2016-07-05 02:38:52.1900000 -04:00'
my sql:
CONVERT(VARCHAR(19),datecolumn,120)
this returns :2016-07-05 02:38:52.
But when i load this column to my text file in ssis package from oledb to flatfile. it loads like this:
2016-07-05 02:38:52.0000000 +00:00.
Any reason why it behaves like this, can anyone tell me how to fix it?
July 25, 2016 at 10:30 pm
Quick question, what is the output data type?
😎
This task is trivial and a simple conversion to SMALLDATETIME should do the trick
DECLARE @dt DATETIME = GETDATE();
SELECT
,CONVERT(SMALLDATETIME,@DT,0)
;
July 27, 2016 at 3:25 pm
My query column coversion to varchar :
CONVERT(varchar(19),[Date],0) =2016-07-05 02:38:52
Before conversion date column value in table: 2016-07-05 02:38:52.1900000 -04:00
Since there is change in flat file columns, i changed datatype on flatfile task -> connection manager->column ->column datatype ->dbdate
Still not working
July 27, 2016 at 3:30 pm
komal145 (7/27/2016)
My query column coversion to varchar :CONVERT(varchar(19),[Date],0) =2016-07-05 02:38:52
Before conversion date column value in table: 2016-07-05 02:38:52.1900000 -04:00
Since there is change in flat file columns, i changed datatype on flatfile task -> connection manager->column ->column datatype ->dbdate
Still not working
Use the correct style parameter with the convert function
😎
July 27, 2016 at 3:50 pm
I used Convert(varchar(19) , [Date] ,120 )
still i get the same in text file with datetimeoffset
July 28, 2016 at 9:11 am
here is the ccolumn date output in text file :2016-07-05 02:38:52.1900000 +00:00
The column from table is of type datetimeoffset
truncation of timezone apprears in tsql but not when loaded to test file.
Need the format 2016-07-05 02:38:52 in text file too.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply