you tried to execute a query which does not include the specified expression as part (1 Viewer)

Rik_StHelens

Registered User.
Local time
Today, 21:30
Joined
Sep 15, 2009
Messages
164
I have a report based on a simple select query (Access 2007).

When I run the query, everything is fine and I get the results I expect.

However, when I run the report I get the error "you tried to execute a query which does not include the specified expression [tblinspection].[inspectiondate] as part of the aggregate function"

At query level the user is asked to give a registration number and/or fleet name

The report groups results by vehicle registration, with a page header at the top.

I use no other grouping in the report, and I can't see what else is wrong with the report.

Any ideas?

Thanks for your help
 

boblarson

Smeghead
Local time
Today, 13:30
Joined
Jan 12, 2001
Messages
32,059
Is this: [tblinspection].[inspectiondate] in the query? Or is it anywhere in the report?
 

Rich

Registered User.
Local time
Today, 21:30
Joined
Aug 26, 2008
Messages
2,898
How do you enter the reg no when the Report's opening?
 

Rik_StHelens

Registered User.
Local time
Today, 21:30
Joined
Sep 15, 2009
Messages
164
Thanks for your replies. To answer your question:

a) [inspectiondate] is in the query. The query contains every field in the table. It would be easier to give customers a datasheet view. But, it is the layout of the data that is important - it has to be laid out in a vehicle schematic style, with individual tyre data on each wheel position.

b) When the report is run, it is passed parameters from the query, which are typed into pop up boxes.

I know that it would be better to pass in parameters from a combo box (by fleet then/or reg), but it is a big database, with a lot of different queries and reports in it. And we have a lot of other projects on at the minute, such as a new system we are integrating and its one more thing I could do without. Its just a quick report for 1 specific haulage rental customer


Hope this helps
 

HGMonaro

Registered User.
Local time
Tomorrow, 06:30
Joined
Apr 22, 2010
Messages
61
usually when i get that msg it's because I'm trying to summarise something that can't be due to the field type. since you're query works, have you got some summary field on the report? (are you trying to summarise a date?)
 

Rik_StHelens

Registered User.
Local time
Today, 21:30
Joined
Sep 15, 2009
Messages
164
usually when i get that msg it's because I'm trying to summarise something that can't be due to the field type. since you're query works, have you got some summary field on the report? (are you trying to summarise a date?)


No there are no summaries in there (unless i'm missing something).

I have attached a sample db with the query in it because hopefully it will show what I cant describe so well.
 

Attachments

  • TINCANsample.mdb
    448 KB · Views: 257

Rik_StHelens

Registered User.
Local time
Today, 21:30
Joined
Sep 15, 2009
Messages
164
Ok i've just reviewed my sample DB and the query works.

But it still does not work in the other database!

The only difference is that I have made the sample a .mdb file instead of .accdb

would this really make a difference?
 

boblarson

Smeghead
Local time
Today, 13:30
Joined
Jan 12, 2001
Messages
32,059
I just converted it to ACCDB and it works fine for me in that format as well.
 

Users who are viewing this thread

Top Bottom