Hi all,
I'm not sure if this is the correct forum, but as you are all multi-skilled...
I am using MS Query from Excel to extract data from Oracle tables via the MS Oracle ODBC driver. The following (stripped down) query returns the correct records and values. The item units_pakd/std_pack_qty is a calculated field based on two items from the two tables concerned. This is working correctly. However, I only want to return 1 summary record with this calculated item totalled.
SELECT MANH_CARTON_DTL_INQRY.CARTON_NBR, units_pakd/std_pack_qty
FROM PKMS1.ITEM_MASTER ITEM_MASTER, PKMS1.MANH_CARTON_DTL_INQRY MANH_CARTON_DTL_INQRY
WHERE ITEM_MASTER.SKU_ID = MANH_CARTON_DTL_INQRY.SKU_ID AND ((MANH_CARTON_DTL_INQRY.CARTON_NBR='9035443'))
If I add the following:
order by MANH_CARTON_DTL_INQRY.CARTON_NBR
group by MANH_CARTON_DTL_INQRY.CARTON_NBR
I get the following error:
Didn't expect 'group' after the column list in the ORDER BY clause.
What am I doing wrong?
I'd prefer to do this rather than return all the records into a pivottable because the volumes could be very large.
Thanks,
Henio
I'm not sure if this is the correct forum, but as you are all multi-skilled...
I am using MS Query from Excel to extract data from Oracle tables via the MS Oracle ODBC driver. The following (stripped down) query returns the correct records and values. The item units_pakd/std_pack_qty is a calculated field based on two items from the two tables concerned. This is working correctly. However, I only want to return 1 summary record with this calculated item totalled.
SELECT MANH_CARTON_DTL_INQRY.CARTON_NBR, units_pakd/std_pack_qty
FROM PKMS1.ITEM_MASTER ITEM_MASTER, PKMS1.MANH_CARTON_DTL_INQRY MANH_CARTON_DTL_INQRY
WHERE ITEM_MASTER.SKU_ID = MANH_CARTON_DTL_INQRY.SKU_ID AND ((MANH_CARTON_DTL_INQRY.CARTON_NBR='9035443'))
If I add the following:
order by MANH_CARTON_DTL_INQRY.CARTON_NBR
group by MANH_CARTON_DTL_INQRY.CARTON_NBR
I get the following error:
Didn't expect 'group' after the column list in the ORDER BY clause.
What am I doing wrong?
I'd prefer to do this rather than return all the records into a pivottable because the volumes could be very large.
Thanks,
Henio