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 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Convert Date-format in DTS

Author  Topic 

kvangaev
Starting Member

1 Post

Posted - 2005-11-09 : 06:15:41
I want to create a csv-file with data. In that data is a datetime field. In the csv-file the date has to be of the format YYYY-MMM-DD.
How can I do this in a DTS ?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-09 : 06:30:32
Try these


select Replace(right(convert(varchar(11),getdate(),9),4)+' '+Substring(convert(varchar(12),getdate(),9),1,6),' ',' ')

select cast(year(getdate()) as varchar)+'-'+left(datename(month,getdate()),3)+'-'+cast(day(getdate())as varchar)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -