Hi All,
I'm kinda new at this access stuff and not real good at all this code stuff. What I want to do is calculate an expiration date for 2 criteria. If a product is invoiced I want it to expire 1 year from the invoice date. If the invoice date has a null value I want it to use the install date and expire 3 years from that date. I have a table with the install date, invoice date and expiration date fields. Then on the form I want it to put a Yes or No in a text box so I know at a glance if it is expired or not. The If/Then looks something like this.
ExpirationDate = InvoicedDate + 1 Year
If InvoicedDate = Null
Then ExpirationDate = InstallationDate + 3 Years
If ExpirationDate >= Today
Then Expired = Yes
If ExpirationDate < Today
Then Expired = No
How do I make it into code that Access understands? I tried the DateAdd function which worked but it doesn't do everything I need. Thanks for any help.
I'm kinda new at this access stuff and not real good at all this code stuff. What I want to do is calculate an expiration date for 2 criteria. If a product is invoiced I want it to expire 1 year from the invoice date. If the invoice date has a null value I want it to use the install date and expire 3 years from that date. I have a table with the install date, invoice date and expiration date fields. Then on the form I want it to put a Yes or No in a text box so I know at a glance if it is expired or not. The If/Then looks something like this.
ExpirationDate = InvoicedDate + 1 Year
If InvoicedDate = Null
Then ExpirationDate = InstallationDate + 3 Years
If ExpirationDate >= Today
Then Expired = Yes
If ExpirationDate < Today
Then Expired = No
How do I make it into code that Access understands? I tried the DateAdd function which worked but it doesn't do everything I need. Thanks for any help.
