Hi all!
I've been fighting an Access date "math" problem and I hope someone here can assist.
I have two dates: Certification, Recertification. Both are only good for 3 years. If either go a day past 3 years, the document is expired. My report that I have built intends to show the multiple states of expiration and document status, as well as count the amount of documents in a given state. I'm also providing a 30 day warning to show documents that are nearing expiration: Expiring. Both date fields in the primary table can have an empty field. These are not indexed values. The report I am writing the expressions in uses unbound text boxes for the calculations. Forgive my below code if there is any erroneous text, I am writing this from another computer and practically have these expressions memorized.
Expressions I have been attempting to use to solve these questions:
Code:
Expiring Certs: =Sum(IIf(Nz([RecertDate], 0)=0, IIf(DateDiff("d", [CertDate], Now())<1094, IIf(DateDiff("d", [CertDate], Now())>1063, 1, 0), 0), 0))
Expiring Recerts: =Sum(IIf(Nz([RecertDate], 0)<>0, IIf(DateDiff("d", [RecertDate], Now())<1094, IIf(DateDiff("d", [RecertDate], Now())>1063, 1, 0), 0), 0))
Expired Certs: =Sum(IIf(Nz([RecertDate], 0)=0, IIf(DateDiff("d", [CertDate], Now())>1094, 1, 0), 0))
Expired Recerts: =Sum(IIf(Nz([RecertDate], 0)<>0, IIf(DateDiff("d", [RecertDate], Now())>1094, 1, 0), 0))
Is there a simpler way to get this report to count these documents than what I'm currently doing? Does anyone have any suggestions for figuring out date value calculations with more than two dates? (Notice that in this instance, I have three dates: Now, Cert, & Recert. You can count a fourth and fifth if you deem the 30 days prior to the Cert and Recert dates.) I'm trying to limit the amount of queries, so running report calculations off a master query allows me to interpret "live" records, not pre-screened records.
Cheers!
Ken