[Solved] New Query gives error message

Creating tables and queries

[Solved] New Query gives error message

Postby baxtec » Mon Aug 06, 2018 12:50 pm

Hi,
I have a .odb file that contains a number of Queries that all work fine. I added a new column headed " IHT 405" to the Table and populated it with single-character entries. I then made a new Query, copying exactly the content of one of the existing, working, Queries except that I changed the Field to "IHT405" (the original Field column is also populated with single-character entries).
I also retained the original "Group" selection in the Function field for the new Query and then tried to run it.

I got an error message "Not in aggregate function or group by clause"

Any assistance would be greatly appreciated.

CRB
Last edited by baxtec on Mon Aug 06, 2018 9:43 pm, edited 1 time in total.
CRB Open Office 4.1.5 Windows 10
baxtec
 
Posts: 3
Joined: Mon Aug 06, 2018 11:40 am

Re: New Query gives error message

Postby Sliderule » Mon Aug 06, 2018 3:14 pm

baxtec wrote:I also retained the original "Group" selection in the Function field for the new Query and then tried to run it.

That is the reason you are receiving the error message.

Each column defined in your SELECT clause, OR your Visible line ( that is containing a check mark ) if using the GUI ( Graphic User Interface ) must EITHER:

  1. On the Function line be Group or Aggregate Function, such as SUM, Minimum, Maximum, Average etc

  2. Using 'raw' SQL, each Select column must either be a Aggregate Function, OR, in the Group by clause
I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
User avatar
Sliderule
Volunteer
 
Posts: 1139
Joined: Thu Nov 29, 2007 9:46 am

Re: New Query gives error message

Postby baxtec » Mon Aug 06, 2018 7:52 pm

Hi Sliderule,

Many thanks for your prompt response. I think I already meet the rules you have specified, but as an 80-year old database newbie I could be wrong. I attach the details of both the existing working Query and the non-working new one in case that helps.

I would appreciate your further comments.

Thank you.

CRB
Attachments
1808 06 Working Query_0001.pdf
(88.5 KiB) Downloaded 6 times
1808 06 Non-working Query_0001.pdf
(109.52 KiB) Downloaded 5 times
CRB Open Office 4.1.5 Windows 10
baxtec
 
Posts: 3
Joined: Mon Aug 06, 2018 11:40 am

Re: New Query gives error message

Postby Sliderule » Mon Aug 06, 2018 8:03 pm

In your Query, that is NOT working, UNCHECK on the Visible line for the Field When.

The reason, as in your Query that does work, that column is NOT Visible ( returned ) . . . or . . . part of the Select clause.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.
User avatar
Sliderule
Volunteer
 
Posts: 1139
Joined: Thu Nov 29, 2007 9:46 am

Re: New Query gives error message

Postby baxtec » Mon Aug 06, 2018 9:41 pm

Hi Sliderule,

Brilliant-you have fixed it! I appreciate your help very much.

Cheers,

CRB
CRB Open Office 4.1.5 Windows 10
baxtec
 
Posts: 3
Joined: Mon Aug 06, 2018 11:40 am


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 2 guests