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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

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

Posting Yak Master

124 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.

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  
 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.02 seconds. Powered By: Snitz Forums 2000