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 |
|
c.vaibhav
Starting Member
26 Posts |
Posted - 2009-10-14 : 09:24:01
|
| Hi friends,I have a database which has multiple entries for the same date.SQL tables doesnt have only date columns, there is only a datetime column so these entries though belong to the same date but have different times.Hence when I use the sum function and I group them by date it still gives me two separate entries.Can anyone help?Regards,Vaibhav |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2009-10-14 : 09:26:25
|
| Any chance of example data? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-10-14 : 09:26:40
|
[code]select dateadd(day, datediff(day, 0, datecol), 0), sum(othercol)from sometablegroup by dateadd(day, datediff(day, 0, datecol), 0)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
c.vaibhav
Starting Member
26 Posts |
Posted - 2009-10-15 : 01:49:13
|
| Thanks alot!!!! |
 |
|
|
|
|
|
|
|