Discussion Locked

Updating A Table In Access

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an Access database set up. I want to be able to add 120 days to my hire date field and then enter this date automatically into my rehire date field in my table. Then from my rehire date field I need to constantly update this field by 120 days to another field which would cycle through every 120 days. How could I do this?

7 replies

by eewhite

You can use an update query to update the rehire date and the other field with (hiredate +120) and (hie date +240).

I think it may be an easier way to do this. Please provide more information on what you are actually trying to accomplish.(My initial recommendation is that you consider adding 120 days to the SYSTEM DATE rather than creating multiple fields with dates going out 120 days.)

Elaine

by donq

Sorry, I don't understand what you are trying to do!

Set Default to NOW()+120 and in the Hire Date field you want to automate. Automatically entered NEW values can then be changed whenever or via code on a regularly scheduled basis??? What I think you want just doesn't make sense!

by steve barrow

It looks like you want to be reminded when you are due to renew your hire contract. If this is the case you can check the original hire vs today and see if there is a comparison.
like:
now()-hiredate mod 120 if the answer is 0 then a 120 day period has elapsed.
use the int(now()-hiredate/120) to see the number of cycles.
note if hiredate is a string field use val() to convert to a number.

Hope this helps

Steve

This discussion is closed to new replies.