I'm attempting to create a query to show an expiration date of an authorization for my employees. The authorization expiration is based upon their age at the time they were given the authorization, 5 years if under 40 at the time of authorization, 2 years if 40 or older. It is also valid until the end of the calendar month which it expires.
I've created the query from a table:employees with fields; employees!lastname, employees!firstname, employees!DateofBirth, employees!AuthorizationDate.
I used a DateDiff function to create AgeAtAuthorization by comparing DateofBirth and Authorization Date.
Next I used an IIF to return the AuthorizationExpirationDate based on the AgeAtAuthorization and AuthorizationDate. I also used a SerialDate calculation to return the end of the calendar month value for the AuthorizationExpirationDate.
Query works great and I get the correct ExpirationDates for all the employees. Now I'd like to limit the results by query or what shows on my ExpirationReport. When I try to limit the AuthorizationExpirationDate column on the query to >Now()+30 it prompts for an AgeAtAuthorization parameter.
If I try to write a second query with AuthorizationExpirationDate column critera >Now()+30 I get the data type mismatch in criteria expression.
I suspect my problem is the Serial Date calculation in the middle of the query is incompatible with the Now() Criteria at the end.
I'm really new to access, your patient and concise help is appreciated!
I've created the query from a table:employees with fields; employees!lastname, employees!firstname, employees!DateofBirth, employees!AuthorizationDate.
I used a DateDiff function to create AgeAtAuthorization by comparing DateofBirth and Authorization Date.
Next I used an IIF to return the AuthorizationExpirationDate based on the AgeAtAuthorization and AuthorizationDate. I also used a SerialDate calculation to return the end of the calendar month value for the AuthorizationExpirationDate.
Query works great and I get the correct ExpirationDates for all the employees. Now I'd like to limit the results by query or what shows on my ExpirationReport. When I try to limit the AuthorizationExpirationDate column on the query to >Now()+30 it prompts for an AgeAtAuthorization parameter.
If I try to write a second query with AuthorizationExpirationDate column critera >Now()+30 I get the data type mismatch in criteria expression.
I suspect my problem is the Serial Date calculation in the middle of the query is incompatible with the Now() Criteria at the end.
I'm really new to access, your patient and concise help is appreciated!