Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date field to csv file

Status
Not open for further replies.

leyland

Technical User
Nov 21, 2002
10
I'm trying to export a table to a csv file which I need to schedule every night using dts.

The table contains some fields that have dates as a datetime data type.

I need the csv file to contain dd/mm/yyyy. I have tried various things like changing datatype in the table design field but still get the time element when transforming.

I have also played with the convert command and can get the info I need through a query but not through the transformation process. Any directions would be appreciated!!
 
in your datapump, build the query and use the following on DateTime fields.

Code:
SELECT  CONVERT(Char(10),MyDateField,101),
        CONVERT(Char(10),GetDate(),101),
        AllMyOtherfields
FROM MyTable

Thanks

J. Kusch
 
Thanks Jay - I ended up using substring to flip the dates prior to loading them to sql tables - this sorted the problem and they come out through dts as I want them .I'll have a play with your suggestion aswell.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top