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
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Date format export

Author  Topic 

benking9987
Posting Yak Master

124 Posts

Posted - 2012-09-07 : 16:19:46
I am using SSIS to export a sql statement. Within that sql statement is a portion for date. I want the date to come out into the .txt file as YYYY-MM-DD. I am able to generate this string just fine in the SQL query window and in the SSIS previews, with the following:

SELECT CONVERT(VARCHAR(10), AZ_Order_Child.Ship_Date,120 ) AS [ship-date]...


HOWEVER, when it comes out onto the actual text file, I get the following:

2012-09-07 00:00:00

What I want is 2012-09-07 only.

Any ideas what is causing this and how I can stop it? Like I said, the query results and export preview show it formatted exactly as I want it.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-09-08 : 07:32:18
Most likely, your destination column type is a datetime type. Go into Advanced Editor in the destination and under Input Output properties, look up the DataType of the column and change if necessary.
Go to Top of Page
   

- Advertisement -