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 |
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-13 : 00:38:27
|
| Hi all. Is it possible to convert the date to shortdate?select e.hireddate from hremployees eit returns 2/07/2007 12:00:00 AMHow can i neglect the time?Thanks-Ron- |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-13 : 00:42:21
|
the time will always be there. However you can set it to 00:00:00 by usingselect dateadd(day, datediff(day, 0, e.hireddate), 0)from hremployees e You can also use convert() to format the date into the required format. But it is best that you do any formatting that you required in your front end application / report KH |
 |
|
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-13 : 01:07:37
|
| so it means time cannot be neglected / hidden?yes, if i tried to convert the format in my report, it will affect some fields that have null dates. null will be changed to date. thanks-Ron- |
 |
|
|
mk_garg20
Constraint Violating Yak Guru
343 Posts |
Posted - 2007-03-13 : 01:19:15
|
| check this outselect convert(varchar,e.hireddate,103) from hremployees emk_garg |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-13 : 01:28:34
|
quote: null will be changed to date.
what do you mean by this ? KH |
 |
|
|
cwtriguns2002
Constraint Violating Yak Guru
272 Posts |
Posted - 2007-03-13 : 01:28:44
|
| thanks mk_garg... ur d'best!-Ron- |
 |
|
|
|
|
|