Answered by:
Adding a New Date Column

Question
-
This is probably simply answered, but I can't find it on the web...
I'm importing data from an existing Excel file, and I need to add a few columns using the Derived Column Transformation tool. As I add strings, I simply put double quotes and it types tehm fine; numerics, I just put 0 and, again, they type fine.
But, I don't know how to put in a date to get it to type as DT_DATE. I tried "0000-00-00," '0000-00-00,' and 0000-00-00, but they all error out, unable to parse.
What do I put in the Expression field on the tool to get it to initialize the column as DT_DATE?
Thanx!
Friday, February 13, 2015 9:40 PM
Answers
-
or if you want an empty date column: NULL(DT_DATE)
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Proposed as answer by SSISJoostMVP Monday, February 16, 2015 10:20 PM
- Marked as answer by Katherine Xiong Tuesday, February 17, 2015 1:31 AM
Friday, February 13, 2015 10:06 PM -
or if you want an empty date column: NULL(DT_DATE)
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
Oh! Ha! There it is...
That works. I was putting the NULL after the casting.
- Marked as answer by Adam Quark Monday, February 16, 2015 9:08 PM
Monday, February 16, 2015 9:08 PM
All replies
-
Can you Type cast that string and test ?
Narsimha
- Proposed as answer by Katherine Xiong Sunday, February 15, 2015 5:42 AM
Friday, February 13, 2015 9:57 PM -
or if you want an empty date column: NULL(DT_DATE)
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
- Proposed as answer by SSISJoostMVP Monday, February 16, 2015 10:20 PM
- Marked as answer by Katherine Xiong Tuesday, February 17, 2015 1:31 AM
Friday, February 13, 2015 10:06 PM -
Can you Type cast that string and test ?
Narsimha
Monday, February 16, 2015 9:06 PM -
or if you want an empty date column: NULL(DT_DATE)
Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter
Oh! Ha! There it is...
That works. I was putting the NULL after the casting.
- Marked as answer by Adam Quark Monday, February 16, 2015 9:08 PM
Monday, February 16, 2015 9:08 PM