December 6, 2008 at 1:08 am
Hi,
Please help me with a query to get records in the latest month.
I will be using this query in my reports which will be executed any time.
I have a table storing the item No.,Quantity,transdate.
Item No. Qty Transdate
--------------------------------
560-00 5 11/12/08
560-00 4 10/11/08
567-980 3 10/11/07
567-980 2 10/11/08
567-980 3 11/11/08
456-890 2 10/11/07
When I execute this report it should return
Item No. Qty Transdate
--------------------------------
560-00 5 11/12/08
567-980 2 10/11/08
567-980 3 11/11/08
456-890 2 10/11/07
Madhav.
December 6, 2008 at 2:01 am
chatexpert (12/6/2008)
Hi,Please help me with a query to get records in the latest month.
I will be using this query in my reports which will be executed any time.
I have a table storing the item No.,Quantity,transdate.
Item No. Qty Transdate
--------------------------------
560-00 5 11/12/08
560-00 4 10/11/08
567-980 3 10/11/07
567-980 2 10/11/08
567-980 3 11/11/08
456-890 2 10/11/07
When I execute this report it should return
Item No. Qty Transdate
--------------------------------
560-00 5 11/12/08
567-980 2 10/11/08
567-980 3 11/11/08
456-890 2 10/11/07
Madhav.
Please define what you mean by latest month. In the above record set you have data from both October and November of 2008 (even one record from 07).
December 6, 2008 at 3:37 am
Item No. Qty Transdate
--------------------------------
560-00 5 11/12/08
560-00 4 10/11/08
567-980 3 10/11/07
567-980 2 10/11/08
567-980 3 11/11/08
456-890 2 10/11/07
When I execute this report it should return
Item No. Qty Transdate
--------------------------------
560-00 5 11/12/08
567-980 2 10/11/08
567-980 3 11/11/08
456-890 2 10/11/07
In the above for item 567-980 has transaction in October & November but I require transactions only in the month of November (as it the latest month) and in the case of 456-890 latest transaction was in month of November so I require all transaction of item 456-890 in November.
If there was a transaction for item in 456-890 then I am not concerned of November, then I require all transactions of 456-890 in December.
Madhav.
December 6, 2008 at 4:30 pm
For a better, tested answer quicker. please see the link in my signature below.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply