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 |
|
pravin14u
Posting Yak Master
246 Posts |
Posted - 2007-03-02 : 02:28:49
|
| Hi All,I need to extract the data part only( Ex: 12-12-2006 and not 12-12-2006 10:40:000) from a smalldattime variable.How can this be done?( I dont want to use the Datepart functio thrice to get day, month and year separately)Thanks,Prakash.P |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-02 : 02:55:54
|
[code]select dateadd(day, datediff(day, 0, @datevar), 0)[/code] KH |
 |
|
|
Stevo
Starting Member
8 Posts |
Posted - 2007-03-02 : 14:25:16
|
| select convert(varchar(10),getDate(),105)+Stevo |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-03-02 : 14:40:08
|
| select dateadd(day, cast(@datevar - 0.50000004 as int), 0)Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|