on 04-03-2008 12:32 PM
Hi All
I am creating a report which details the Item code, Item Description, In stock amount, Commited amount and the Price one particular price list. I want this to be grouped by the Item Group. The query below is the one I have created. It works well until i add anything into the Group by section.
SELECT T1.[ItemCode],
T1.[ItemName],
T2.[OnHand],
T2.[IsCommited],
T0.[Price]
FROM ITM1 T0 INNER JOIN
OITM T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod
INNER JOIN OPLN T4 ON T0.PriceList = T4.ListNum
WHERE T4.[ListName] = 'Selling Prices GBP'
GROUP BY T3.[ItmsGrpNam]
I receive the following error when exectued:
Column 'OITM.ItemCode' is invalid in the select list because it is not contained in either an aggregate function or the GOUP BY clause
Can anyone help?
Thanks in advance
Gail
Edited by: Gail Patterson on Apr 3, 2008 1:32 PM
Hi,
Please remove the group by function and try it out. Since you are not using any sum function on it.
Thanks
SAGAR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can u use this query
SELECT T3.ItmsGrpNam, T1.ItemCode, T1.ItemName, T2.OnHand, T2.IsCommited, T4.ListName, T0.Price
FROM ITM1 T0 INNER JOIN
OITM T1 ON T0.ItemCode = T1.ItemCode
INNER JOIN OITW T2 ON T1.ItemCode = T2.ItemCode
INNER JOIN OITB T3 ON T1.ItmsGrpCod = T3.ItmsGrpCod
INNER JOIN OPLN T4 ON T0.PriceList = T4.ListNum
WHERE T4.ListName = 'Selling Prices GBP'
It can help u.
Thanks
SAGAR
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.