PDA

Click to See Complete Forum and Search --> : need assistance with complex sql statement


Thai
Mar 23rd, 2000, 03:18 AM
Hello I am trying to put together an SQL statement that gathers information from two tables. Here is what I am trying to do.. The [Inventory Sold] table lists all of the parts that were sold, and the [Inventory] table is the table with all of the inventory information. The [Inventory Sold] table only has the fields Number, Description, and Qty. I am using COUNT/GROUP in my statement so only one instance of "Number" in the [Inventory Sold] will show up in the recordset and the count to return how many times it was actually there. I got that part all down and dandy, but I need to know how to get the PRICE from the [Inventory] table where the Number from [Inventory Sold] = Number from [Inventory].

This SQL statement works but it does not have the PRICE from [Inventory] included:

SELECT Number, Description, Qty, COUNT(Number) as Sold FROM [Inventory Sold] GROUP Number, Description, Qty


Now.. sorry for all the babble.. how do I modify that to add the PRICE from the [Inventory] table into it?

Thanks,
Thai

Thai
Mar 23rd, 2000, 04:52 AM
Nevermind everyone, after racking my brain for a while I pieced together an SQL statement that works perfectly.. whew! Thanks anyway :)

Thai