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 |
|
Swati Jain
Posting Yak Master
139 Posts |
Posted - 2006-08-10 : 07:31:44
|
| How to Extract only date from datetime in sql query?Select CreatedDate from table I get both date as well as timeBut i want only dateHow to do that?Swati |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-08-10 : 07:38:40
|
| [code]select dateadd(d,0,datediff(d,0,CreatedDate)) from table[/code]or[code]select convert(varchar(20),CreatedDate) from table[/code]Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
vmurali
Yak Posting Veteran
88 Posts |
Posted - 2006-08-10 : 08:11:57
|
| Try thisselect convert(varchar,getdate(),101) - mm/dd/yyyy formatselect convert(varchar,getdate(),103) - dd/mm/yyyy format |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-08-10 : 13:06:43
|
| Select DateAdd(day,DateDiff(day,0,DateColumn),0) from yourTableMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|