Page 1 of 1

[Solved] New Query gives error message

Posted: Mon Aug 06, 2018 12:50 pm
by baxtec
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

Re: New Query gives error message

Posted: Mon Aug 06, 2018 3:14 pm
by Sliderule
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.

Re: New Query gives error message

Posted: Mon Aug 06, 2018 7:52 pm
by baxtec
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

Re: New Query gives error message

Posted: Mon Aug 06, 2018 8:03 pm
by Sliderule
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.

Re: New Query gives error message

Posted: Mon Aug 06, 2018 9:41 pm
by baxtec
Hi Sliderule,

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

Cheers,

CRB