query to compare records from two diff dates

robina

Access Developer
Local time
Today, 09:11
Joined
Feb 28, 2012
Messages
102
I have a table that contains the following fields: ID (autonumber), Item, billing date(mmm/yyyy), count, and approved.

My first query returns records where the approved field is null. My second query returns returns all records for 2 months ago where the approved field is not null.

This is my problem, I need to pull records that have NOT been approved for the prior month BUT if they were approved 2 months ago AND the count is the same, it does not need to be returned in the query. Also, if it was approved 2 months ago but the count is different than what it is for 1 month ago, it needs to show in the query.

I have wrestled with this for days. I appreciate any help.
 
Sorry to say this... but it would be best if we could see some sample data.. Your description makes very little sense..
 
Sure.
ID Item billing date count approved.
1 Midrange Critical Apr/2013 200 Yes
2 Midrange Critical May/2013 200
3 Intel High Apr/2013 526 Yes
4 Intel High May/2013 300

This should return Record ID 4 because it is the only record that isn't approved for this month, and the count for this item is different than the same item 2 months ago. If its still unclear please let me know.
 

Users who are viewing this thread

Back
Top Bottom