Hi all,
I have 3 tables:
1. Orders (where all the order details are stored)
2. Status_Lookup (where all the possible statues are stored, like Received, Pending, Dispatched, Closed)
3. Order_Status (where every time the order status changes, its recorded).
E.g
Orders: Status_Lookup Order_Status
Order_Id Id Status Order_Id Id DateAdded
1 1 Received 1 1 1/1/2003
2 2 Pending 1 2 1/2/2003
3 3 Dispatched 2 2 3/2/2004
4 Closed 3 4 5/4/2005
Now I actually want to display individual orders with their current statuses. E.g
Order_Id Status Status_Date
1 Pending 1/2/2003
2 Pending 3/2/2003
3 Closed 5/4/2005
Any help over the query will be highly appreciated!
Thanks!
I have 3 tables:
1. Orders (where all the order details are stored)
2. Status_Lookup (where all the possible statues are stored, like Received, Pending, Dispatched, Closed)
3. Order_Status (where every time the order status changes, its recorded).
E.g
Orders: Status_Lookup Order_Status
Order_Id Id Status Order_Id Id DateAdded
1 1 Received 1 1 1/1/2003
2 2 Pending 1 2 1/2/2003
3 3 Dispatched 2 2 3/2/2004
4 Closed 3 4 5/4/2005
Now I actually want to display individual orders with their current statuses. E.g
Order_Id Status Status_Date
1 Pending 1/2/2003
2 Pending 3/2/2003
3 Closed 5/4/2005
Any help over the query will be highly appreciated!
Thanks!