If date field is older than so many months, show text string. (1 Viewer)

areeves65

New member
Local time
Today, 06:56
Joined
Aug 2, 2019
Messages
2
Hi All, keep in mind i'm a beginner at access and this is my first post. Please do help if you can.

I'm trying to do a calculation on a date that contains certification dates of employees, then return text if criteria is met. If the certification date is 12 months or older, it is expired. If the certification date is older than 10 months but less than 12, it needs re-certification.

I had a query working with the Field shown below, but now it just returns #Error:
Code:
Certification Status: IIf([Certification Date]<=Format([Certification Date],DateAdd("m",-12,Date())),"Expired",IIf([Certification Date]<=Format([Certification Date],DateAdd("m",-10,Date())),"Needs ReCert","NA"))

Thanks
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:56
Joined
Feb 19, 2013
Messages
16,610
I think what you want is
IIf([Certification Date]<=DateAdd("m",-12,Date()),"expired",IIf([Certification Date]<=DateAdd("m",-10,Date()),"Needs ReCert","NA"))
 

areeves65

New member
Local time
Today, 06:56
Joined
Aug 2, 2019
Messages
2
CJ you're my hero!!!!!! Thanks.
 

Users who are viewing this thread

Top Bottom