Discussion Locked

Grouping dates into days

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to group a date Range result set of say one month into days between 22:00:00 and 21:59:59. I's this possible with SQL or do I have to do it in my .NET application?

4 replies

by bop_zw

That will return a result set that is NOT grouped! My problem is how do I group records of the same date but different times?

by tony hopkinson

I hope you're reading these you semm to have sacttered this question all over the place.
Depends on what dbms and mind spotty memory but
Select DatePart(Day,MydateField) DayNo, Sum(Value)
From MyTable
Group By DayNo

or something close should do the trick

by itpreneur

select day(vardate) from table
where vardate between
startdate and enddate
group by day(vardate)
order by day

This discussion is closed to new replies.