Date related query

spectrolab

Registered User.
Local time
Today, 13:40
Joined
Feb 9, 2005
Messages
119
Hi,

I'm not sure if this is the right group, but I am sure it will involve some VBA. I have quite a large Db that contains some quality assurance data, what I am trying to do is set-up a system that will check the date of the last record in a table (the date is one of the fields) and determine whether the data is within or outside the time limit allowed for the data. For example, the data might be valid for a week, a month, a year etc. The validity period will be stored in another table.
So basically what I need is some sort of code that will check once a day all the tables that have validity time periods and pop up a message window saying that the last data is no longer valid for "XXXXXX" please up date the data.
I hope that makes sense, I have a had a thorough look through the search function, but I'm not quite sure what to ask for, if anyone can point me in the right direction, that would be great.
 
Sounds more like an SQL issue. You want a query that returns those results. Basically, add the validity period to the date and see if it's less than today.

You might then use some code to check and see if that query returns records. If it does, pull up a form displaying them, or a message box, or whatever you want.
 
People talk about first and last but in SQL terms you most likely want to use Min() or Max() to retrieve rows with the data you seek.

You can run a query in your opening form each day that checks the time limit. Use VBA to examine the results and display a message or do something for tables that are out of date.
 

Users who are viewing this thread

Back
Top Bottom