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

Aggregate function error

I have an invoice form with Parts and Labor as subforms. The parts section
is based on a query that pulls data from 2 tables (tblParts & tblPartPerClaim)
.. It has fields: ClaimID: tblPartPerClaim; NET PRICE: tblParts; Quantity:
tblPartPerClaim; and a calculated field Part Total: ([NET PRICE]*[Quantity]).
On my subform, I have a text box in the footer that displays the sum of the
Part Total field (=Sum([NET PRICE]*[Quantity])). This text box is called
PartsClaimed.

I need to be able to store this value. I tried using a query that has two
fields. ClaimID: tblPartPerClaim & Parts Claimed: Sum(tblParts.[NET PRICE]
*tblPartPerClaim.{Quantity}). The ClaimID is set to Group By. The Parts
Claimed field is set to expression. I also tried setting it to sum, but with
no change in the result.

Either it will tell me something wasn't included in an aggregate function or
it comes up asking me for the NET PRICE. I'm not any good with SQL, so
please just show me how to structure the query with the appropriate formulas.

Thanks for your help,

Shannan
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #1
2 1441
Nevermind I finally got. I figured out you have to have the tables showing
in the upper part of the window with their relationships.

Shannan
Shannan Casteel wrote:
I have an invoice form with Parts and Labor as subforms. The parts section
is based on a query that pulls data from 2 tables (tblParts & tblPartPerClaim)
. It has fields: ClaimID: tblPartPerClaim; NET PRICE: tblParts; Quantity:
tblPartPerClaim; and a calculated field Part Total: ([NET PRICE]*[Quantity]).

On my subform, I have a text box in the footer that displays the sum of the
Part Total field (=Sum([NET PRICE]*[Quantity])). This text box is called
PartsClaimed.

I need to be able to store this value. I tried using a query that has two
fields. ClaimID: tblPartPerClaim & Parts Claimed: Sum(tblParts.[NET PRICE]
*tblPartPerClaim.{Quantity}). The ClaimID is set to Group By. The Parts
Claimed field is set to expression. I also tried setting it to sum, but with
no change in the result.

Either it will tell me something wasn't included in an aggregate function or
it comes up asking me for the NET PRICE. I'm not any good with SQL, so
please just show me how to structure the query with the appropriate formulas.

Thanks for your help,

Shannan

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #2
Now I have the same problem with the Labor Amount.

There is a difference. The labor amount is based on a Labor Rate entered on
the main form multiplied by the Total Hours. Total Hours is a calculated
field on the JobCodes subform. It sums the hours for each job in the list.
(Sum([Hours])) Labor Rate is entered by the user on the main form. I tried
this with the Labor Claimed field in the query I was trying to create....
Labor Claimed: ((Sum([Hours])*[LaborRate]) with total set to expression.
It tells me I have not included the formula in an aggregate function.

What's wrong?

Shannan

Shannan Casteel wrote:
Nevermind I finally got. I figured out you have to have the tables showing
in the upper part of the window with their relationships.

Shannan
I have an invoice form with Parts and Labor as subforms. The parts section
is based on a query that pulls data from 2 tables (tblParts & tblPartPerClaim)

[quoted text clipped - 18 lines]

Shannan

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #3

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

Similar topics

2
by: jc | last post by:
Hi. Just as we have AVG(COLUMN_NAME) and MAX(COLUMN_NAME) how can I write my own variation of a such a function. If I can appreciate how to do this, then I hopefully I can write a...
1
by: sausage31 | last post by:
I have a table as follows.... Device LotID Result1 Result2 Result3 aaa 1 5 10 15 bbb 1 2 4 6 aaa 2 ...
1
by: Najib Abi Fadel | last post by:
Hi i have an ordered table of dates let's say: 1/1/2004 8/1/2004 15/1/2004 29/1/2004 5/2/2004 12/2/2004
1
by: R.A.M. | last post by:
Hello, I am learning SQL Server 2005. I have (correctly) written in .NET assembly DemoSQLServer with aggregate function AvgNoMinMax in class Demo and I have added assembly to database...
5
by: BillCo | last post by:
I just wasted a long time figuring out this and I figure if I post it might save someone some pain! Jet (DAO) will allow you to to use nested aggregate functions like building blocks, e.g.: ...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
3
by: ncsthbell | last post by:
I am pulling my hair out on this! Seems like it should be easy, I just can not get it to work like I want. I know I am doing something wrong, so I hope someone can be so kind to guide me!!! I...
7
by: kpfunf | last post by:
Getting the following error opening a report, cannot figure out the cause: "You tried to execute a query that does not include the specified expression 'RQ_FuelQuoteReportHistory.Vendor' as part...
8
by: Floortje | last post by:
Hi i have been struggeling with this question for quite some time now. I have some helper classes that handle images (upload an image, create thumbnails and show a imagelist), links (add link,...
4
by: shapper | last post by:
Hello, I have the following Linq query: var q = (from p in database.Posts join pt in database.PostsTags on p.PostID equals pt.PostID join t in database.Tags on pt.TagID equals t.TagID group...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...

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.