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

Aggregate function error opening a report

78
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 text box displaying vendor and that didn't work. There is no summing, etc. in the query. Any suggestions on what to check?
Jun 24 '08 #1
7 2455
Annalyzer
122 100+
I get this one all the time! It's caused by not including the field in a GROUP BY statement in your SQL. If it's not included in the aggregate function, it has to be included in the GROUP BY.
Jun 24 '08 #2
kpfunf
78
I tried that, and no luck. I've dealt with this error before as well in queries, but the error is only occuring when I run the report, not when I run the actual query.
Jun 24 '08 #3
Annalyzer
122 100+
I haven't been able to reproduce the error and I'm not by any means an Access Expert. I'm sorry I couldn't help. Hopefully, one of the real experts will jump in here soon and help you out.
Jun 25 '08 #4
Stewart Ross
2,545 Expert Mod 2GB
Hi. I think we'll need to see the SQL for the report's recordsource query to be able to advise further...

-Stewart
Jun 25 '08 #5
kpfunf
78
Expand|Select|Wrap|Line Numbers
  1. SELECT M_Locations.TrainingCenterID, [Master Fuel History].FuelID, [Master Fuel History].QuoteDate, [Master Fuel History].FuelType, [Master Fuel History].VendorID, [Master Fuel History].Vendor, [Master Fuel History].Price, [Master Fuel History].AvGasDiscount, [Master Fuel History].AvGasMarkup, [Master Fuel History].AirportID, [Master Fuel History].[Airport Name]
  2. FROM [Master Fuel History] INNER JOIN M_Locations ON [Master Fuel History].AirportID = M_Locations.AirportID
  3. GROUP BY M_Locations.TrainingCenterID, [Master Fuel History].FuelID, [Master Fuel History].QuoteDate, [Master Fuel History].FuelType, [Master Fuel History].VendorID, [Master Fuel History].Vendor, [Master Fuel History].Price, [Master Fuel History].AvGasDiscount, [Master Fuel History].AvGasMarkup, [Master Fuel History].AirportID, [Master Fuel History].[Airport Name];
I get the same error with or without grouping.
Jun 25 '08 #6
Stewart Ross
2,545 Expert Mod 2GB
OK, there is no apparent issue with the SQL recordsource. if you are able to run the query itself OK but running the report generates an error It suggests there is something in your report - a subtotal perhaps, or something within the report's grouping and ordering - which is causing the error. Hard to advise at this stage without seeing the report.

I note that the field as named in post 1 is sourced from a table RQ_FuelQuoteReportHistory that does not appear in the recordsource query. Is there a calculated control on the report, or a reference to such a control in the grouping and so on, which is incorrect somewhere?

-Stewart
Jun 25 '08 #7
kpfunf
78
Somehow, the Order By had the RQ...Vendor in it. I have no idea how that ended up like that, but thanks for the heads up! It didn't even register in my brain that the two "Vendor" fields were different.
Jun 26 '08 #8

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

Similar topics

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 ...
3
by: eddiec | last post by:
hi everyone, I have a report in an adp that uses aggregate functions in its record source and I am trying to figure out how to filter the records displayed in the report: DoCmd.OpenReport...
10
by: neb | last post by:
Dear member of the forum, Ms access has built-in aggregate function like: -Sum, Max, First, Avg, ... Is it possible to build user-defined aggregate? (if you have any clue, do not hesitate to...
0
by: Not Me | last post by:
Hey, I have a report featuring a handful of subreports, a field taking values from the main record source, and a field in the report footer which displays the sum of values in said field. The...
5
by: Dean | last post by:
Has anyone toiled with creating/using alternate domain aggregate functions? I have been messing with that a little. The one recordsource I have been working indicates I get 20 to 40% savings in...
0
by: BillCo | last post by:
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.: ...
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.: ...
3
by: Aaron | last post by:
I have been searching the boards trying to find an answer to this question and no luck. I am using a query similar to this: Select count(col1) from table1 I was having a hard time accessing...
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...
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?
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
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
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...
0
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,...

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.