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
 General SQL Server Forums
 New to SQL Server Programming
 CSV datetime

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2011-10-07 : 10:04:08
Dear All

I tried to display date in [07 October 2011] format (month need to disply in full)

by using below query
STUFF(CONVERT(VARCHAR(24),GETDATE(), 106), 4,3,DATENAME(month,GETDATE()))as Date

Its working fine.But when i export the result as .csv file(using reporting service) it changes to [07-Oct-11] format.

What i need to do to display in same format in csv.Any help is highly appreciated

Regards,
SG

theboyholty
Posting Yak Master

226 Posts

Posted - 2011-10-07 : 10:58:18
I haven't tried this, but try CASTing or CONVERTing the whole thing to a VARCHAR.

SELECT CAST(STUFF(CONVERT(VARCHAR(24),GETDATE(), 106), 4,3,DATENAME(month,GETDATE())) AS VARCHAR) as [Date]


---------------------------------------------------------------------------------
http://www.mannyroadend.co.uk A Bury FC supporters website and forum
Go to Top of Page

satheesh
Posting Yak Master

152 Posts

Posted - 2011-10-07 : 12:09:06
Thank you for your reply.But i am facing same issue again.

Regards,
SG
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-10-07 : 15:34:34
Are you using the wizard to export? You need to change the destination column format to text. You can save the SSIS and edit the flat file destinations datatypes.



Poor planning on your part does not constitute an emergency on my part.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-08 : 03:23:54
can you try using Formatdatetime function in ssrs?

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

Go to Top of Page
   

- Advertisement -