Id Product Quantity Amount Date
1 Shoe 4 200 2011-08-27
2 Shoe 2 100 2011-08-28
3 Cap 2 50 2011-08-28
4 Shirt 1 300 2011-08-28
5 Cap 1 25 2011-08-29
6 Shoe 1 50 2011-08-29
7 Shirt 2 600 2011-08-29
This my database structure. what I want to know is how to get the quantity value for the last inserted row of Cap before today which is 2011-08-29.
I need a query to solve this problem for me.
thanks in advance
joe