Not sure if this is the right forum. I'm using Microsoft Query to get data from our ERP. However, every time I try to sum a column, I get a syntax error.
Here's the sql statement:
SELECT inmast.fpartno, inmast.frev, inmast.fcstscode, inmast.fdescript, inmast.fonhand, inmast.fstdcost, inmast.fprice, Sum(shitem.fshipqty) AS 'Sum of fshipqty'
FROM inmast inmast, shitem shitem, shmast shmast
WHERE shitem.fpartno = inmast.fpartno AND shitem.frev = inmast.frev AND shitem.fshipno = shmast.fshipno AND ((shmast.fcnumber Like 'ING%') AND (shmast.fshipdate Between {d '2006-01-01'} And {d '2006-12-31'}))
GROUP BY inmast.fpartno, inmast.frev, inmast.fcstscode, inmast.fdescript, inmast.fonhand, inmast.fstdcost, inmast.fprice
ORDER BY inmast.fpartno
Sum(shitem.fshipqty) is what is causing the syntax error (gives me the correct data without the sum(..) ) The syntax error appears on all the "sum" options: max, min, count, etc.
I've even tried breaking it down to only 1 table and 2 simple columns, and I still get a syntax error upon trying to sum.
Help?
Thx,
Jo