473,379 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Running total in query

I have a query which shows the following fields and orders by every one
in turn from left to right in ascending order. The fields are DATE,
[STAFF INITIALS], WORK, [hours]*[rate], DESCRIPTION and [UNIQUE REF].

How can I get a running total of the [hours]*[rate] field?

I need to use every single field to find whether a record occurs before
the current record. I have tried using the DSum function in various
ways but cannot get it to work. The date field is in the format
dd/mm/yyyy. Staff initials and work are text fields. Description is a
memo field. Hours and rate are number fields.

Nov 13 '05 #1
1 3807
????? wrote:
I have a query which shows the following fields and orders by every one
in turn from left to right in ascending order. The fields are DATE,
[STAFF INITIALS], WORK, [hours]*[rate], DESCRIPTION and [UNIQUE REF].

How can I get a running total of the [hours]*[rate] field?

I need to use every single field to find whether a record occurs before
the current record. I have tried using the DSum function in various
ways but cannot get it to work. The date field is in the format
dd/mm/yyyy. Staff initials and work are text fields. Description is a
memo field. Hours and rate are number fields.

I sometimes wonder if running sums might be better to calc when the
record is added/deleted/modified.

It the query you could sort the table by staffid and date. In a column
enter somethink like
PriorRate:Select Sum(Hours*Rate) From TheTable Where StaffID =
[StaffId] And DateField < [DateField]

This will store the run the select process for each record and sum up
the rate*hours for all dates prior to the current records date.

This query will not be snappy if you have lots of records to compute.

You might want to see if MS still has the file QrySmp97, an MDB with
lots of query examples similar to this one
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Peter Bailey | last post by:
I have a query that returns weekly enrollments: Qrygetweeklycountofdosmoduleenrollments Week Commencing Week Ending Total Bookings 02/04/2004 02/04/2004 0 05/04/2004 09/04/2004 0 12/04/2004...
2
by: Peter Bailey | last post by:
I have a query that creates a graph of bookings from the course start date looking back 20 weeks based on a running sum. I also have a query that counts the number of bookings before that 20 week...
8
by: Tony Williams | last post by:
I have a database that hold s figures for each quarter. I want to create a query whereby the user can ask for the running total of the data upto the quarter they enter into a prompt. The database...
1
by: u473 | last post by:
Running Totals by date misbehaving I applied to the letter the sample code given on http://support.microsoft.com/?kbid=290136 but it seems the running total breaks when the day number is less...
1
by: u473 | last post by:
I am scratching my head with the required quotes and parentheses. I started with an existing working Query with Running Total by date. Now I need to produce a running total by quarter day, so I...
16
by: Gandalf186 | last post by:
I need to create a query that produces running totals for every group within my table for example i wish to see: - Group A 1 5 9 15 Group B
1
by: nick.leggin | last post by:
I have a recordset that includes the following data Location Territory Sales Total Sales % of total sales A location can have multiple territories, and each territory has different sales
2
by: Jana | last post by:
Using Access 97. Background: I have a main report called rptTrustHeader with a subreport rptTrustDetails in the Details section of the main report. The main report is grouped by MasterClientID. ...
3
by: Richard Hollenbeck | last post by:
I hope this isn't too confusing. The following query runs pretty fast by itself, but when I want to use it in a report (pasted below the query), it takes at least fifteen seconds to run! Then I...
7
by: Lewe22 | last post by:
I have a query pulling information from multiple tables, one of which contains a list of students with an auto number their assessment information and how long the assessment took in minutes . ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

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.