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.
Author |
Topic |
masond
Constraint Violating Yak Guru
447 Posts |
Posted - 2013-03-13 : 05:11:02
|
Hey guys Sorry to bother you so early in the morning, but i need some help and advice. This is my table SELECT TOP 5 [FDMSAccountNo] ,[Open_Date] FROM [FDMS].[dbo].[Dim_Outlet]Which produces the following results FDMSAccountNo Open_Date878000000884 20030521878000001882 20090709878000002880 20090709878000003888 20090709878000004886 20090709I want to change the open date into the following format “2003-05-21T12:00:00Z”Required outcomeFDMSAccountNo Open_Date878000000884 2003-05-21 T12:00:00Z878000001882 2009-07-09 T12:00:00Z878000002880 2009-07-09 T12:00:00Z878000003888 2009-07-09 T12:00:00Z878000004886 2009-07-09 T12:00:00Z |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-13 : 06:39:25
|
this should be done at the front end application layer as its a presentation issue. Handling this in sql end will require casting to varchar which is bit of an overkill and will make further date manipulation with these values difficult------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Robowski
Posting Yak Master
101 Posts |
Posted - 2013-03-13 : 06:45:14
|
Sorry if this double posts, my posts don't seem to be showing up.You probably want to output it for xml datetime 126check the below link for a full list of options. You may need to add a +'z' at the end though.http://www.blackwasp.co.uk/SQLDateTimeFormats.aspx |
|
|
|
|
|