Hi.
Thanks, that kind of worked. It is showing all items (even the ones that did not sell, which is good), but only when I don't put in a date range. When I put in a date range, it is still only viewing the items in my inventory that sold for that date range. I need it to list all items in inventory even if it didn't have a sell in that date range.
Here is my query now:
SELECT inventory.itemId AS Item_ID, inventory.itemName AS Item, inventory.itemDesc AS Description, inventory.itemSize AS Size, inventory.itemColor AS Color, inventory.partNum AS Part_Number, inventory.prodLine AS Product_Line, inventory.itemPrice AS Price, inventory.itemQty AS Quantity_Available, (inventory.itemQty*inventory.itemPrice)AS Total_Value_of_Available, SUM(orderdetails.DetailQuantity)AS Quantity_Sold, SUM(orderdetails.DetailQuantity*inventory.itemPrice)AS Total_Value_of_Usage
FROM orderdetails RIGHT OUTER JOIN inventory ON orderdetails.DetailItemId = inventory.itemId LEFT OUTER JOIN orders ON orderdetails.DetailOrderId = orders.OrderId
GROUP BY inventory.itemId
ORDER BY inventory.itemName ASC
And here is how my date range is set up:
$WADbSearch1->addComparisonFromEdit("OrderDate","S_OrderDate","AND",">=",2);
$WADbSearch1->addComparisonFromEdit("OrderDate","E_OrderDate","AND","<=",2);
I found the above method for date range in another thread here in the DataAssist forum.
What am I doing wrong?
Thanks!