469,887 Members | 1,390 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,887 developers. It's quick & easy.

Calculate daily averages based on Working Shifts

I have a simple table containing a datetime field and a number of data fields.

I need to develop a stored procedure that will accept two dates as parameters and report back the average daily value for 'field1' for each day in between the two parameters. However the complicating factor is that the 'day' is consdered to be when the dayshift starts, therefore a day would start at 7:00AM and proceed until 6:59AM the following calendar day.

It's clear how to perform this operation if I was looking at calendar day averages, but I have no idea how to start given the requirement of basing the query on a different time of day, could anyone give me some clues?
Jul 18 '07 #1
1 1385
srinit
43
I have a simple table containing a datetime field and a number of data fields.

I need to develop a stored procedure that will accept two dates as parameters and report back the average daily value for 'field1' for each day in between the two parameters. However the complicating factor is that the 'day' is consdered to be when the dayshift starts, therefore a day would start at 7:00AM and proceed until 6:59AM the following calendar day.

It's clear how to perform this operation if I was looking at calendar day averages, but I have no idea how to start given the requirement of basing the query on a different time of day, could anyone give me some clues?
Hi,
Can you send me how you tried it
Jul 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Mick White | last post: by
96 posts views Thread by david ullua | last post: by
3 posts views Thread by ken.ditto | last post: by
3 posts views Thread by paeh | last post: by
1 post views Thread by Michel | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.