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 |
desikankannan
Posting Yak Master
152 Posts |
Posted - 2013-11-18 : 07:54:54
|
Hi,i want to convert dattime to shortdate2013-10-15 00:00:00.000 i want to display 10/15/2013 , iam doing sorting in asp.net its should not varcharDesikankannan |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-11-18 : 08:26:45
|
If you are doing it in ASP.Net, use ToString with format specifier = "d". See here: http://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspxYou could do a similar thing in SQL, but I would recommend doing the conversion in ASP.Net. If you do want to do the conversion in SQL, use convert(CHAR(10),YourDate,101) |
|
|
|
|
|