Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Derive column

Author  Topic 

nguyenl
Posting Yak Master

128 Posts

Posted - 2009-02-04 : 17:00:44
Hi,

I Am creating an SSIS package.

My source table has a column name of SALE_DATE (datetime), the data in this column is 7/22/1996 12:00:00 AM. How would I use a derive column object to change the date format to 7/22/1996, and move it over to its source table which has column SALE_DATE(datetime)?

Thankyou

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-02-04 : 17:22:06
Use a query as the source and use dateadd(dd, datediff(dd,0,SALE_DATE), 0) for your column.
Go to Top of Page

nguyenl
Posting Yak Master

128 Posts

Posted - 2009-02-04 : 17:28:23
Thanks for you reply.

It says it can't "parse" the expression.
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2009-02-04 : 17:33:36
It should run fine, try it in Query Analyser and see what it returns.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-05 : 07:53:37
did you give it an alias too? like
dateadd(dd, datediff(dd,0,SALE_DATE), 0) as  SALE_DATE


you need to provide alias in query window in ssis for it to take column info correctly in metadata


Go to Top of Page
   

- Advertisement -