Basically, I am querying 3 columns in MySQL, Item_id, Date, and New_Qty. When I use the max function on the date column, the other columns all display their maxes for the same date range.
SELECT `item_id` , max(date) AS max_date ,`new_qty`
FROM `item_warehouse_link_history`
WHERE warehouse_id =1
AND item_id=1000
AND DATE
BETWEEN '2010-10-01 12:00:00'
AND '2010-10-07 12:00:00'
So, while I'm trying to find "new_qty" for the latest date, the latest date pops up just fine, but the "new_qty" is the max for the entire range.
Any help is appreciated!