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 |
mike13
Posting Yak Master
219 Posts |
Posted - 2010-09-22 : 10:25:00
|
Hi all,i got this date in one table 8/29/2010 7:22:55 PM and want to convert it to 8/29/2010How do i do that?thanks a lot! |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-22 : 10:39:30
|
Do the formation at front end applicationOtherwise use thisselect dateadd(day,datediff(day,0,datecol),0) from tableMadhivananFailing to plan is Planning to fail |
 |
|
mike13
Posting Yak Master
219 Posts |
Posted - 2010-09-22 : 11:21:43
|
quote: Originally posted by madhivanan Do the formation at front end applicationOtherwise use thisselect dateadd(day,datediff(day,0,datecol),0) from tableMadhivananFailing to plan is Planning to fail
Thanks that did the trick! |
 |
|
glendcruz
Yak Posting Veteran
60 Posts |
Posted - 2010-09-22 : 20:54:39
|
declare @date datetimeset @date = '8/29/2010 7:22:55 PM'select convert(varchar,@date,101)---------08/29/2010(1 row(s) affected) |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-09-23 : 05:36:52
|
quote: Originally posted by glendcruz declare @date datetimeset @date = '8/29/2010 7:22:55 PM'select convert(varchar,@date,101)---------08/29/2010(1 row(s) affected)
Now the date values are actually varcharsMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|