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)
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.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy