Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WILL WORK FOR CODE! Need help with date fields

Status
Not open for further replies.

airbus2

Technical User
Apr 16, 2008
31
US
I have to track when an employee initially recieved their badge, the day it expires, and the day they actually renewed it.

The first field is a date field called "Initial", it represents the date they were issued a badge. The second date field called "Recurrent" represents the date the employee actually came in and renewed their badge. I have an unbound field "Expire Date" (not sure if thats the best way to do it) that should display an annual date of 730 days (2 years) from the day they initially got their badge, or 365 days (1 year) from the day they renewed the badge.

Code would flow something like this in an If/then statement:
If Recurrent = Null the Expire = Initial + 730. If not Expire = Recurrent + 365.

I need help designing the right code. Both fields are within the same table.
 




Hi,

Will code for peanuts! ;-)
Code:
Expire: IIf(Recurrent = Null , Initial + 730 , Recurrent + 365)


Skip,

[glasses]Have you heard that the roundest knight at King Arthur's round table was...
Sir Cumference![tongue]
 
airbus2
If you are out of peanuts, you could try appeasing SkipVought by clicking on :
Thank SkipVought
for this valuable post!

;-)
 
for better results, either:
Code:
Expire: IIf(Recurrent Is Null , Initial + 730 , Recurrent + 365)
or:
Code:
Expire: IIf(IsNull(Recurrent), Initial + 730 , Recurrent + 365)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top