473,394 Members | 1,696 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,394 software developers and data experts.

How do I calculate a running balance or running sum in Access?

Hello,

I am building a database to help me figure out what my costs are on each job. Part of those costs are labor (payroll) and I am paying the employees for each piece they complete, aka piecework. In order to comply with the labor law standards, I am paying employees minimum wage @ $8.00/hr. While they are working on the piece, I pay the employee by the hour @ $8 and deduct the amount I pull from their total piece price. When they complete the piece, I pay them any money they may have left over from the draws I made as they progressed in completing the project.

I have built a Piecework table which includes the [Employee Name], [Job Name], [Piecework Total]. I have also built a Payroll query which calculates the [Total Hours] worked per day on each job for each [Employee Name] with the total amount of [Earnings] for each day. I would like to include the [Piecework Total] from my Piecework table and somehow build an expression that deducts the [Earnings] from each [Piecework Total] as the employee progressively works on the project. I know this might sound a little complex or confusing so here is an illustration of my database.

Tables:
[Piecework Total]
Employee Name
Job Name
Piecework Total

[Employees]
Employee Name
Hourly Rate
Etc.

Payroll Query
Employee Name
Date
Hourly Rate
Start Time
End Time
Total Hours: [End Time]-[Start Time]
Earnings: [Total Hours]*[Hourly Rate]

So here's what I would like to add to my new query or report (whichever will support the information I am trying to find):
Piecework Total of $500 assigned to John Smith for 1234 ABC Lane
3/5/2012- 8 hours, earnings $64, 1234 ABC Lane $436
3/6/2012- 8 hours, earnings $64, 1234 ABC Lane $372
3/7/2012- 8 hours, earnings $64, 1234 ABC Lane $308
3/8/2012- 8 hours, earnings $64, 1234 ABC Lane $244
3/9/2012- 8 hours, earnings $64, 1234 ABC Lane $180
John Smith completes the piece on 3/9/12 and collects the remaining balance of $180.

So what I am trying to do is calculate a running balance/sum. How do I do this in Access? Can I do this in a query or does it have to be done in a report? Please help.
Mar 16 '12 #1
1 4985
Mihail
759 512MB
First of all I think that yo need a good lecture:
http://bytes.com/topic/access/insigh...ble-structures

After you read that you will understand (I hope) that every table must have an ID field (preferable AutoNumber) that unique identify a record in that table.
As example your database should look like this:

Expand|Select|Wrap|Line Numbers
  1. [Employees]
  2. Employee_ID (Autonumber - Primary key)
  3. Employee Name (Text - Required)
  4. Hourly Rate (Double - Required)
  5. Etc.
  6.  
  7. Another table will be
  8. [Piecework]
  9. Piecework_ID (Autonumber - Primary key)
  10. Piecework_Total (Double - Required)
  11.  
  12. Now you can assign a piecework to an employee:
  13. [AssignedPieceworks]
  14. Assigned_ID (Autonumber - Primary key)
  15. Employee_ID (Lookup on table [Employees] - Required)
  16. Piecework_ID (Lookup on table [Piecework] - Required)
  17. Labor_Start (Date/Time - Required)
  18. Labor_End (Date/Time)
  19.  
  20. After that is a good idea to store partial payments:
  21. [PartialPayments]
  22. PartialPayment_ID (Autonumber - Primary key)
  23. Assigned_ID (Lookup on table [AssignedPieceworks]] - Required)
  24. Partial_Payment (Double - Required
  25.  

Hope this is a help for you to start your database.
Of course this is not a "template" because is very possible that I misunderstand the real situation.
Mar 17 '12 #2

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

Similar topics

3
by: Patrick Fisher | last post by:
What are the implications of running a MS-Access BE and an SQL-Server BE on the same Terminal Server? Assuming that the TS can handle the load are there any other issues? Thanks Patrick
5
by: bobdydd | last post by:
Hi Guys Can anyone help I am trying to find a way to implement a running balance that will re-calculate if the date order is changed, or if an earlier record is changed like you might want to do...
2
by: jaypee1978 | last post by:
Anyone know how can I create a running balance in a datagrid? In MS-Access this could be very simple. This is what my sql in MS-Access query: SELECT AccountDetails.AccountDetailID AS...
4
by: jackbenimble999 | last post by:
Hello! Has anyone had trouble running macros on the Access runtime version on Vista? I tried enabling macros in the trust center, and thought for sure this would solve the problem! But, alas, my...
2
by: mauking | last post by:
Hello Everyone, Im a certified public accountant here in the Philippines. Im using microsoft access 2000 and 2003 running in a Windows XP environment. Im having a problem of how to calculate a...
3
by: kpfunf | last post by:
I have a standard Transactions table with debits and credit. I need a report that shows a running balance after each transaction. In Excel, this would be something like the following (B: Debits, C:...
0
by: dustonheaven | last post by:
I need to calculate running balance on data containing Null, which is sorted by few columns. As example below, Clr is sorted by Null Desc, then by date, then just by ID. So far, I just come out...
5
by: Marsha McCarthy | last post by:
Question. I have a database with two tables: Table 1 - Invoice Table - Transaction ID (Auto Number) - Invoice Number - Invoice Date - Invoice Amount
1
by: Marsha McCarthy | last post by:
I am building a fixed asset database and I would like to get some assistance in calculating depreciation.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.