| Author |
Topic  |
|
|
varunm
Starting Member
25 Posts |
Posted - 09/21/2006 : 11:43:23
|
hello Members, I need only date from datetime. when i select dt from table(where dt has datatype datetime) it shows date and time.
Please help me,i tried cast but throws me error. |
|
|
TG
Flowing Fount of Yak Knowledge
USA
5467 Posts |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 09/21/2006 : 12:13:47
|
Select DateAdd(day,DateDiff(day,0,Datecol),0) as Date_Only from yourTable
Madhivanan
Failing to plan is Planning to fail |
 |
|
|
varunm
Starting Member
25 Posts |
Posted - 09/21/2006 : 13:15:51
|
| I made it ,but can you will be clear.Because I am new to SQL SERVER. |
 |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 09/21/2006 : 21:01:57
|
quote: Originally posted by varunm
I made it ,but can you will be clear.Because I am new to SQL SERVER.
What did you make?
Madhivanan
Failing to plan is Planning to fail |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
USA
6997 Posts |
|
|
varunm
Starting Member
25 Posts |
Posted - 09/21/2006 : 21:44:59
|
Members, I tried to change the datetime to only date.Its easy:
select convert(varchar,'columnname',101') |
Edited by - varunm on 09/22/2006 12:21:39 |
 |
|
|
DonAtWork
Flowing Fount of Yak Knowledge
2111 Posts |
|
|
madhivanan
Premature Yak Congratulator
India
22460 Posts |
Posted - 09/23/2006 : 08:49:43
|
quote: Originally posted by varunm
Members, I tried to change the datetime to only date.Its easy:
select convert(varchar,'columnname',101')
Also,If you use front end application, use the format function there
Madhivanan
Failing to plan is Planning to fail |
 |
|
| |
Topic  |
|