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)
 Write to text destination only the 2006-03-13

Author  Topic 

ismailc
Constraint Violating Yak Guru

290 Posts

Posted - 2008-03-04 : 06:18:59
Hi,

I want to convert/write from my source to my text file: the date column.

I have a date column of : 2006-03-13 00:00:00.000

but when it writes to flat destination i only want to write: 2006-03-13

Any ideas, Please assist!

Regards

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-03-04 : 06:24:36
use convert(varchar(10), datecol, 121)


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ismailc
Constraint Violating Yak Guru

290 Posts

Posted - 2008-03-04 : 09:26:41
Hi, thanks for the assist!

I tried an expression in derived column:
convert(varchar(10),[WeekStDte],121)

convert(varchar(10),[WeekStDte])

with data type : string(DT_STR)

Please assist, Regards
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-03-05 : 03:59:11
select convert(varchar(10),getdate(), 121)

What is the datatype of WeekStDte?

Madhivanan

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

mwjdavidson
Aged Yak Warrior

735 Posts

Posted - 2008-03-05 : 05:01:38
You can use a data conversion task to convert to DT_DBDATE. This will strip out the time portion.

Mark
Go to Top of Page
   

- Advertisement -