February 27, 2013 at 10:23 pm
How to convert datetime to string format (YYYYMMDD) in SSIS?
I have done using Datepart but for the date 01 to 09 it gives the values as 1 to 9. I need values should be as 01. Anybody guide me
February 27, 2013 at 10:48 pm
Not sure how to do it in SSIS but in T-SQL:
CONVERT(VARCHAR(8),MyDateCol, 112)
Can you convert it prior to SSIS doing its thing?
February 28, 2013 at 1:13 am
karthick.alangattan (2/27/2013)
How to convert datetime to string format (YYYYMMDD) in SSIS?I have done using Datepart but for the date 01 to 09 it gives the values as 1 to 9. I need values should be as 01. Anybody guide me
You can get round the issue you mentioned by doing something like this (untested):
right("0" + Datepart(...), 2)
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
February 28, 2013 at 9:14 am
Here's another option.
REPLACE((DT_WSTR, 10)(DT_DBDATE)GETDATE(),"-","")
February 28, 2013 at 10:10 am
kl25 (2/28/2013)
Here's another option.
REPLACE((DT_WSTR, 10)(DT_DBDATE)GETDATE(),"-","")
Good stuff - this is the way to go.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply