Hello,
I am trying to build a query that subtotals the amount of hours worked and earnings made per pay period for each employee. I built a Payroll table with employee name, start time, end time, lunch in, lunch out, hourly rate and added these fields to my query to form new fields with expressions to calculate the total hours worked per day (end time- start time) and the earnings made per day (total hours worked per day x hourly rate)and now I would like to subtotal the hours worked and earnings made per payperiod for each employee.
I put the criteria for the date field between #1/30/2012#and#2/5/2012#, which is the pay period I want to look at, and I tried grouping the sum of my new field expressions (hours worked per day, earnings made per day) and when I try to run the query summing both expressions, a message pops up saying, "subqueries cannot be used in the expression ([total hours]*[hourly rate])". When I try grouping the sum of one expression, for example the earnings made per day expression field, a message pops up saying, "you need to execute a query that does not include the specified expression '([end time]-[start time])'".
How do I subtotal and grand total my hours and earnings for each employee for the specified date range?
You don't do subtotals and grand totals in a query, you do it in the report.
5 20793
You don't do subtotals and grand totals in a query, you do it in the report.
Thank you Rabbit. I will do that.
@Chelle8263: Actually Rabbit is not correct, you can have subtotal in Query.
Using GroupBy/Total Query like this: -
SELECT Group, SubGroup, Sum(Qty) as MTD
-
FROM Table1
-
GROUP BY Group, SubGroup
-
ORDER BY Group, SubGroup
-
UNION ALL
-
SELECT Group, "Total "&Group as SubGroup, Sum(Qty) as MTD
-
FROM Table1
-
GROUP BY Group
-
ORDER BY Group, SubGroup;
-
@hvsummer, I didn't say you couldn't. Rather, I said you don't. The implication being that it's better to handle subtotals and grand totals on the reporting end rather than using a work around solution on the querying side.
NeoPa 32,556
Expert Mod 16PB
@HVSummer.
Rabbit is quite right here.
Please consider, when offering advice, the sense of that advice. Inexperienced people new to Access often ask for things that are not good for them. It is our responsibility as experts to consider this before simply offering answers. There are many things that we know how to do, yet would never offer as advice without a strong warning against using such an approach. It is irresponsible to do otherwise.
If, after some responsible direction from an expert, the OP still requires direction to go a way that they have been warned against, then that's fine. We aren't baby-sitters. Nevertheless we do have a responsibility to give sensible advice where we can. Bad advice is generally worse than no advice at all, so care and consideration must always be shown.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: CSDunn |
last post by:
Hello,
I have 14 fields on a report that hold integer values. The field names
use the following naming convention: T1Number, T2Number ....T14Number.
I need to get a 'sub total' of all fields as...
|
by: simondsm |
last post by:
I have a video tape library that we use at work here in a MS-Access
database.
When originally desgined, we never thought ot convert the time on the
fly into total seconds, but instead, we stored...
|
by: barkarlo |
last post by:
I need help to make grand total time in continuous forms.
to calculate total work time I use following formula
=format(+1--nz();"short time").
but when I make grand total time in form footer (for...
|
by: mebrabham |
last post by:
Hello,
I am trying to create a running subtotal in a query and then graph the
running subtotal for each city group. The data looks like this in the
table (for illustration):
My City My...
|
by: jessicaeatworld |
last post by:
Hi,
I'm using Access 2003 on Windows XP. I have created a PivotTable View Form and at the bottom is an automatically inserted Grand Total row. I added sum and avg fields and then hid the details so...
|
by: Alagas |
last post by:
Hi, I'm new to access 2003 & would like to know how to create a report that shows the grand total of counts, details are as the following:
1) I've a database of credit cards where I would like to...
|
by: kkshansid |
last post by:
how to get grand total of two years 2001,2002 are fields
SELECT sum( 2001 ) AS "2001-2002", sum( 2002 ) AS "2002-2003", (
"2001-2002" + "2002-2003"
) AS "grand total"
FROM school
this query...
|
by: monstez88 |
last post by:
Hi, I'm trying to create a Invoice form with javascript. Basically, my invoice form should have the field item, cost, quantity and product total.
It shd have a function to allow the user to add...
|
by: shalskedar |
last post by:
In my Database 1 of the Report i need to find the grand total for a field which is inherited from the 1 of the subform..
Ex-The report field control source property is set to as
=!Text1693
...
|
by: GLEberts |
last post by:
I am trying to calculate a Grand Total in a continuous form. This question has probably been beaten to death but I could not find any answers or solutions on how to solve. I am trying to stay away...
|
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,...
|
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...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
| |