J
James
how can i select all orders and group by their status history i.e. order
received, processing, completed BUT, if there is a duplicate status, i only
want it to show the most current status. i have an order table, a statuslog
table. this is ms access. i have pasted some sql i use to return the
latest status by using max in a nested select but how can i show all
statuses for an order but only show the most recent status if theres a dup
status?
SELECT sl.OrderID, sl.Status
FROM Statuslog AS sl
WHERE (((sl.Date)=(SELECT Max(sl2.date)
FROM statuslog As sl2
WHERE sl2.orderid = sl.orderid)));
received, processing, completed BUT, if there is a duplicate status, i only
want it to show the most current status. i have an order table, a statuslog
table. this is ms access. i have pasted some sql i use to return the
latest status by using max in a nested select but how can i show all
statuses for an order but only show the most recent status if theres a dup
status?
SELECT sl.OrderID, sl.Status
FROM Statuslog AS sl
WHERE (((sl.Date)=(SELECT Max(sl2.date)
FROM statuslog As sl2
WHERE sl2.orderid = sl.orderid)));