Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

group by 30 min. intervals

Status
Not open for further replies.

karen4201

Programmer
Mar 9, 2006
37
US
Hi,

I'd like to organize my data based on a datatime field grouped by 30 minute intervals.

I'm thinking about using a CASE statement that would look at the minute and if 0..30 then it would get 1, otherwise it would get 2...so 1 is the first half hour, and 2 is the second half hour. There are probably easier ways to do the 30 minute intervals.

Any suggestions on how to do this?
 
That's a fairly normal way to do it.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top