Adding days onto a date field

Bullman2000_uk

Registered User.
Local time
Today, 18:32
Joined
Jun 6, 2007
Messages
17
I am trying to add a certain number of days onto a date field to create a due date within a Table but can't work out how to do it. I know that to add days on I can use the function DateAdd but the only way I can see how to do this is to create and update query to run and add the date on. Is there anyway that I can set the field to automatically update the due date dependent on the priority of the record e.g. immediate (1 day) standard (3 days) and request (28 Days)?
 
You shouldn't store this, it's a calculated value which can be displayed at any time by a calculated textbox, query etc.
 
i'm not sure rich

it depends whether this is volatile data or not - lets say were talking about a purchase invoice

an invoice dated 15/3/07 may be due for payment on 30/4/07 (end of next month) - i think most systems WOULD store this date for ease of reference - but also that if the enterprise rules change - say the supplier changes his terms to 14 day payment - if you don't store the date, it would look as if ALL the old invoices were being paid late, according to current terms.

as the invoice date should never change there is no problem at all storing the due date , and the easiest way is to calculate this at the time thei nvoice is appended

as far as setting the date, then in your input form, have a visible or non-visible textbox bound to the due date. in the after update event for the input date, put txtduedate = inputdate+xdays, or use any other appropriate function

or do this in the form before update event - both the same - just a matter of taste
 
Surely it's the no of days allowable along with the original date of invoice that should be stored?
 

Users who are viewing this thread

Back
Top Bottom