Query 180 days past Expiration Date

unclefink

Registered User.
Local time
Yesterday, 19:04
Joined
May 7, 2012
Messages
184
Please forgive me if some of this post doesnt make sense as I am confusing myself.

I have a table with person information that has a picture attached directly to the database depicting the person associated.

In a separate table, i have cases associated to the persons table that "expire" one year after being established. One person can be associated to multiple cases.

What I am trying to do is create a query to give me a return of those people who have no active cases 180 days after the last case expiration date.

Ultimately I plan on creating an update query on this return to "delete" the associated picture to those people who have not had an active case in the last 180 days.

We eventually plan on utilizing this database in the field (with NO network access from the "remote" device) so to make transfering easier, I attached the photoes directly to the db however there is no need to keep photographs of people who do not have active cases older than 6 months. If in the case after the 6 months, that person establishes a new case, a new photograph will then be taken.

Really sorry if this is confusing, hopefully not too far off.

I currently have a query set that gives me the name of each person and the max date of their expiration dates so i've got a starting point however have ran into a wall.:banghead: Any suggestions for the next step or even starting over to simplify things.

PS: I am less than a year experienced with Access; however very willing to learn. That being said, there is a very high liklyhood that I will ask lots of follow up questions if you suggest vba coding.

Thank you very much in advance, as always; I greatly appreciate any and all help.
 
First, you can create a query against the one you already have with the max date and in the criteria under max date, type >=DateAdd(d,180,[MaxDate]).

From this query you can then proceed to get counts of cases > 0. You will have to find all personCases with no matching records in the counting query. Those are the cases you will need to delete.

Hope this makes sense.
 

Users who are viewing this thread

Back
Top Bottom