SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Date format export
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

benking9987
Posting Yak Master

121 Posts

Posted - 09/07/2012 :  16:19:46  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 09/08/2012 :  07:32:18  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000