473,789 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculate daily averages based on Working Shifts

1 New Member
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 1531
srinit
43 New Member
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

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

Similar topics

2
1754
by: Mick White | last post by:
http://www.mickweb.com/football/aleague/ratings.html I can't get this to work in IE5.2 Mac, it seems to choke on assigning a table cell's innerHTML property. player.item(player.length-1).innerHTML=av; I'm attempting to add each player's ratings and calculate his average rating. Appears to work in Safari 1.0.2, Netscape 7.0, and Firefox 0.9 (all Mac).
2
2534
by: Jeff Blee | last post by:
I am hoping someone can help me. I am making a Access 97 app for a person and have run up against a problem to do with MS Graph. There is a table that has a number of data elements and a date field and entries are entered each month. A graph is required that has three of the data elements represented basically on the y axis and time as months along the x axis. So for each month there is a group of three columns representing the data...
96
4983
by: david ullua | last post by:
I am reading "Joel on Software" these days, and am in stuck with the question of "how to calculate bitsize of a byte" which is listed as one of the basic interview questions in Joel's book. Anyone could give some ideas?I am expecting your reply. David.
4
6701
by: Mayhem05 | last post by:
I'm hoping someone can guide me on solving this vexing problem I have with a database I built to track a projects. I'm using MS Access 2003 and here are the basics: the database is designed to track companies that are supporting projects and the number of personnel in each company that supports each project. I'm stuck when I want to sum the total number of personnel supporting the project over a period of time. For example: Company A...
3
2225
by: ken.ditto | last post by:
I have a database that stores data collected from a variety of instruments (pressure, temperature, flow rate, etc.) everytime there is a 1% change in the value. The Project Manager wants to be able to take the data and generate a report that shows a series of timed averages across a larger time span. For example, over an eight hour time range, he wants the instrument averages in five minute blocks. 00:00:01 - 00:05:00 Press1avg01 |...
0
1920
by: Rog | last post by:
Who am I?: Hi I am a 'one-man-show' and mainly in the ecommerce and community business based in Western Europe. With over 13 years experience in the internet and telecommunication business, I am very strong focused on the adult site. The last 4 years I have been working as well with 2 programmers where we have covered quiet interesting fields like ecommerce, community building, sms-payment, premium-rated numbers
3
10926
by: paeh | last post by:
hello..can anyone help me. I am beginner in programming. I need to make a system that can calculate moving average. my system process will be executed according to certain schedule such as daily, weekly or monthly based on the data in the database. The moving average will then be recorded for further process. I want to know what is the software should be use to develop it? and can anyone show me a simple coding to calculate moving...
0
4641
by: SuzK | last post by:
I am trying to calculate in VBA in Access 2002 a moving average and update a table with the calculations. Fields in my WeeklyData table are Week Ending (date) ItemNbr (double) Sales Dollars (double) Sales Units (double) Promo (Text) -- is null or "X" AvgWklyDollars (double) AvgWklyUnits (double) I have a vba module which I thought would work, but it doesn't. I think the problem is an embedded SQL Totals Top 8 query, which doesn't...
1
7642
by: Michel | last post by:
Hello, I need to calculate moving averages of weekly data during the last year. After some search, I believe that the best approach will be to get a dataset from the SQL Server database, browse the records and, using an algorithm, calculate the moving average. There is an article on the "Code Project" website entitled "A Simple Moving Average Algorithm" but honnestly I have been unable to
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7529
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.