August 9, 2016 at 4:07 pm
I have a table with datetime column something like this : 08-09-2016 00:00:00
I would like to get only 08-09-2016 from this column while loading to a text file.
I used derived column with expression something like this : (DT_DBDATE)[Date]
This is still not working. Need help
Thanks.
August 10, 2016 at 5:14 am
The CONVERT function supports the format you want to use. Just apply it to a column instead.
SELECT CONVERT(Varchar(10), GETDATE(), 110);
August 10, 2016 at 7:57 am
Ed Wagner (8/10/2016)
The CONVERT function supports the format you want to use. Just apply it to a column instead.
SELECT CONVERT(Varchar(10), GETDATE(), 110);
Do T-SQL functions actually work inn SSIS, Ed? I thought you had to use "DTS" functions only unless it was in a T-SQL script task or stored procedure.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 10, 2016 at 10:00 am
I tried the same...but no use. it still appends 0's for hh:mm:ss. 2016-07-18 00:00:00
I don't need 0's appended at last.
August 10, 2016 at 10:00 am
Jeff Moden (8/10/2016)
Ed Wagner (8/10/2016)
The CONVERT function supports the format you want to use. Just apply it to a column instead.
SELECT CONVERT(Varchar(10), GETDATE(), 110);
Do T-SQL functions actually work inn SSIS, Ed? I thought you had to use "DTS" functions only unless it was in a T-SQL script task or stored procedure.
Doh! I guess I wasn't caffeinated enough yet. Thanks.
Komal, skip my post. Sorry about that.
August 10, 2016 at 10:31 am
To get a specific format from a date into a file, you need to convert it to string.
It's certainly easier to format with a SQL query than with SSIS. If you don't want to use a query as a source in your SSIS package, create a view from the table which returns all the desired formats and use that as a source. Remember to keep your columns as strings, as that the only way to ensure the desired format.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply