Leighton21
Technical User
Hi All,
I am trying to create a stored procedure that accepst a number value (in this case the number represents an hour) the results of the data should then be grouped by this value so for example I have the following
Date Value
07/01/2008 4:15 200
07/01/2008 4:35 221
07/01/2008 5:15 230
07/01/2008 6:15 100
07/01/2008 6:45 120
if the number passed to the SP is 1 (i.e. 1Hr) the result should be
Date Value
07/01/2008 4:00 421
07/01/2008 5:00 230
07/01/2008 6:00 220
(so rolled up fro the hour)
then the number could be 2 (2hr) or any number between 1 and 24 (1day) so for 2 it would be
Date Value
07/01/2008 4:00 651
07/01/2008 6:00 220
is there a group by formula that could take the number parameter and group on the hours required
cheers
I am trying to create a stored procedure that accepst a number value (in this case the number represents an hour) the results of the data should then be grouped by this value so for example I have the following
Date Value
07/01/2008 4:15 200
07/01/2008 4:35 221
07/01/2008 5:15 230
07/01/2008 6:15 100
07/01/2008 6:45 120
if the number passed to the SP is 1 (i.e. 1Hr) the result should be
Date Value
07/01/2008 4:00 421
07/01/2008 5:00 230
07/01/2008 6:00 220
(so rolled up fro the hour)
then the number could be 2 (2hr) or any number between 1 and 24 (1day) so for 2 it would be
Date Value
07/01/2008 4:00 651
07/01/2008 6:00 220
is there a group by formula that could take the number parameter and group on the hours required
cheers