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 |
seeker62
Starting Member
40 Posts |
Posted - 2013-01-18 : 12:55:20
|
ThisFORMAT(CONVERT(VARCHAR(8),CAST(@end_value AS DATE),112), 'MM/DD/YYYY')gives me an error saying that FORMAT is not recognized so how do I format a date string into mm/dd/yyyy |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2013-01-18 : 13:05:20
|
using the 101 option and CONVERT you can get the format you require. Read more in books onlineSELECT CONVERT(nvarchar(10), GETDATE(), 101) AS Convert_to_101 ;Jack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-01-18 : 13:12:13
|
FORMAT() function is only available from 2012 onwardsIdeally you should be trying to do formatting at front end if possible. Converting dates to varchar just for formatting is an overkill------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
seeker62
Starting Member
40 Posts |
Posted - 2013-01-18 : 15:54:53
|
Thanks your input created a fix. |
|
|
|
|
|