SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 How to convert datetime to string format (YYYYMMDD
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

karthick.amace
Starting Member

India
23 Posts

Posted - 02/27/2013 :  23:47:20  Show Profile  Reply with Quote
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)

Singapore
17440 Posts

Posted - 02/27/2013 :  23:58:50  Show Profile  Reply with Quote
convert ( varchar(10) , <date column> , 112 )


KH
Time is always against us

Go to Top of Page

karthick.amace
Starting Member

India
23 Posts

Posted - 02/28/2013 :  00:05:46  Show Profile  Reply with Quote
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

India
52249 Posts

Posted - 02/28/2013 :  00:39:27  Show Profile  Reply with Quote
REPLACE((DT_WSTR, 20) (DT_DBDATE) @[User::yourDateVariable],"-","")

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000