snoopy80
Technical User
- Jun 27, 2001
- 106
Greeting.
I have a situation where I have to display a comparison view of data of an input date to the data of a month earlier than the input date. Does it make sense?
Let say I have a table as follow:
Item Date Qty
----- ------ -----
AAA 5/1/08 10
AAA 5/15/08 20
AAA 6/7/08 2
AAA 6/28/08 18
Now let say the user input a date range 6/01/08 to 6/30/08 then the select statement should return as this:
Item Qty lastmonth
---- ----- -----------
AAA 20 30
I sum all qty sold in June for item AAA which is 20 and also show a comparison for last month the same item has 30 as qty had been sold.
Any idea how to create in the same table showing a current selected month and a previous month data? Thanks for help
I have a situation where I have to display a comparison view of data of an input date to the data of a month earlier than the input date. Does it make sense?
Let say I have a table as follow:
Item Date Qty
----- ------ -----
AAA 5/1/08 10
AAA 5/15/08 20
AAA 6/7/08 2
AAA 6/28/08 18
Now let say the user input a date range 6/01/08 to 6/30/08 then the select statement should return as this:
Item Qty lastmonth
---- ----- -----------
AAA 20 30
I sum all qty sold in June for item AAA which is 20 and also show a comparison for last month the same item has 30 as qty had been sold.
Any idea how to create in the same table showing a current selected month and a previous month data? Thanks for help