473,851 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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]
*tblPartPerClai m.{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.c om
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #1
2 1460
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:
tblPartPerClai m; 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]
*tblPartPerCla im.{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.c om
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.c om
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
7049
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 MEDIAN(COLUMN_NAME) type function or a more general function like a 10% percentile function with syntax such as PERCENTILE(COLUMN_NAME,25). Regards JC......
1
2264
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 3 6 9 I need to determine the mean of all results for each LotID, so used the Row Average function described on the Microsoft Knowledge base, which gives
1
2737
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
2358
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 DemoSQLServer. Now I need to create aggregate in SQL Server. I tried this way: CREATE AGGREGATE AvgNoMinMax(@v float) RETURNS float EXTERNAL NAME .. Unfortunately I have error:
5
6109
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.: SELECT A, sum(B) as Answer1, Answer1 * 2 as DoubleAnswer
2
6138
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 pointers, but I'm not sure. Please help. The code: void equate(matrix *A, matrix *B) { int i, j; assert(A.row_dim == B.col_dim && A.col_dim == B.col_dim); for(i=0; i < A.row_dim; i++) for(j=0; j < A.col_dim; j++)
3
12474
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 have 2 tables: Table1 - columns: Period FuelType Table2 - columns: Period
7
2483
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 of an aggregate function" Not sure why this comes up as Vendor is not part of any aggregate function (that I know of!). The query runs fine. The error occurs when opening the report. Vendor is not used in sorting or grouping. I tried deleting the...
8
2384
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, edit link, show linklist), comments (add comment, show commentlist) etc. I do not need all this functionality on every page. Ideally I could just extend the controller like this
4
4736
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 t by p into pt select new PostPaper {
0
9896
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
9747
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10670
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
10352
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...
0
9505
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5736
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...
0
5933
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4548
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
4143
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.