>Hi all...happy Friday!
>
>Here's my question. I am putting together a query from 2 different tables. One of the tables lists the quantity of an item at every location. So, there's a record in that table for Item #123 at Location 1, Item #123 at Location 2, etc. To get the actual quantity on hand for that item, I need to sum all of the records in that table where Item = #123. This total quantity will be one of my columns in my query result. I also need to get a few other fields from another table (also containing the item number). Can I somehow combine my big select statement with this "sum" select statement so I only have one select query for the whole thing? If this makes any sense, TIA.
>
>erin :)
Try with next code:
SELECT Table1.NoItem, Table2.NameItem, ;
SUM(Table1.Quantity) AS Quantity ;
FROM Table1 ;
INNER JOIN Table2 ON Table1.NoItem = Table2.NoItem ;
GROUP BY NoItem ;
ORDER BY NameItem ;
INTO CURSOR MyQuery
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de
www.PortalFox.comNada corre como un zorro
________________________________