southbeach
Programmer
Wondering if this is at all possible - For now, I am running two query.
(1) First query searches for all records in table A
(2) Using a while loop to display data grid
(3) Within loop, running a 2nd query against table B to get the SUM of two columns
I tried running a single query but was not able to get it to work. Here is what I tried:
I get the error: b.SUM is not a function
Is there logic to my madness? How can I get this to work on a single query?
Thank you all for your assistance
(1) First query searches for all records in table A
(2) Using a while loop to display data grid
(3) Within loop, running a 2nd query against table B to get the SUM of two columns
I tried running a single query but was not able to get it to work. Here is what I tried:
Code:
SELECT a.*, b.SUM(reserved) as QtyRes, b.SUM(available) as QtyAvl FROM header a, detail b WHERE a.key = varKey AND a.linkField = b.linkField
I get the error: b.SUM is not a function
Is there logic to my madness? How can I get this to work on a single query?
Thank you all for your assistance