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 2008 Forums
 SSIS and Import/Export (2008)
 How to convert datetime to string format (YYYYMMDD

Author  Topic 

karthick.amace
Starting Member

23 Posts

Posted - 2013-02-27 : 23:47:20
How to convert datetime to string format (YYYYMMDD)?

I have done using Datepart but for the date 01 to 09 it gives the values as 1 to 9. I need values should be as 01. Anybody guide me

------------------------------------------------------
"Desire makes what you wants to do"

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2013-02-27 : 23:58:50
convert ( varchar(10) , <date column> , 112 )


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

Go to Top of Page

karthick.amace
Starting Member

23 Posts

Posted - 2013-02-28 : 00:05:46
Hi Khtan,
I know in SQL Server...but I need to implement in SSIS

Sry for not mentioning SSIS...

------------------------------------------------------
"Desire makes what you wants to do"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-02-28 : 00:39:27
REPLACE((DT_WSTR, 20) (DT_DBDATE) @[User::yourDateVariable],"-","")

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -