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 |
tyekhan786
Starting Member
9 Posts |
Posted - 2014-03-29 : 08:48:07
|
I need to change the Datetime field to Data only.Current format -- 28/09/2013 12:59:20Format wanted --- 2013-09-28Date only in YYYY-MM-DDThanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2014-03-29 : 09:24:01
|
do the formatting in your front end application KH[spoiler]Time is always against us[/spoiler] |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-03-29 : 09:31:46
|
In 2012, you can CAST it to DATESELECT CAST(datecol as DATE) from tableMadhivananFailing to plan is Planning to fail |
|
|
tyekhan786
Starting Member
9 Posts |
Posted - 2014-03-29 : 10:52:03
|
sorry i have 2008quote: Originally posted by madhivanan In 2012, you can CAST it to DATESELECT CAST(datecol as DATE) from tableMadhivananFailing to plan is Planning to fail
|
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-03-29 : 13:12:53
|
quote: Originally posted by tyekhan786 sorry i have 2008quote: Originally posted by madhivanan In 2012, you can CAST it to DATESELECT CAST(datecol as DATE) from tableMadhivananFailing to plan is Planning to fail
But you have posted this question in 2012 forum. Well. Use the followingSELECT dateadd(day,datediff(day,0,datecol),0) from tableMadhivananFailing to plan is Planning to fail |
|
|
|
|
|