dates

C

Calvin

Can I take a date from one field and use it to automatically calculate a date
in another. How would I do that? In the criteria area of access?
 
J

Jerry Whittle

You can do it in a query, form, or report, but not in a table.

Check out the DateAdd function in Help.
 
C

Calvin

I understand the dateadd function but I want to add to the date in the field.
I don't want to have to go into every record and put the last date in to add
to it? is there a faster way to do this. Could you please give me some detail
instructions I am really struggling with this. I am reading the help and I
just don't know how to do this. I want to take a date entered in the
date/time field and have it give me an automatic date for the next date
 
J

John W. Vinson

I understand the dateadd function but I want to add to the date in the field.
I don't want to have to go into every record and put the last date in to add
to it? is there a faster way to do this. Could you please give me some detail
instructions I am really struggling with this. I am reading the help and I
just don't know how to do this. I want to take a date entered in the
date/time field and have it give me an automatic date for the next date

You want to take the last (most recent??) date in a field and... "add to it"?
Add WHAT to it? Are you trying to set the Default Value property of a date
field to some date calculated from an existing date? If so, what's the
calculation?

John W. Vinson [MVP]
 
P

pietlinden

I understand the dateadd function but I want to add to the date in the field.
I don't want to have to go into every record and put the last date in to add
to it? is there a faster way to do this. Could you please give me some detail
instructions I am really struggling with this. I am reading the help and I
just don't know how to do this. I want to take a date entered in the
date/time field and have it give me an automatic date for the next date

Create a query. Drop in the date field ( the one that has a value),
then create an expression that calculates the date you need... eg.
OtherDueDate:Dateadd("m",3,[OriginalDate]) to add 3 months to the
field OriginalDate

if you're doing this on a form, create an unbound control (textbox)
and then make the DateAdd function the control source for your textbox.
 
C

Calvin

I want to take a date that has already been entered(the last service date).
This will be the last date that the customer was serviced. Each customer
either has a monthly, semiannual or yearly service. I want to auto calculate
the next date to be serviced based on the last date the customer was
serviced. It will have to continue to do this.
 
J

John W. Vinson

I want to take a date that has already been entered(the last service date).
This will be the last date that the customer was serviced. Each customer
either has a monthly, semiannual or yearly service. I want to auto calculate
the next date to be serviced based on the last date the customer was
serviced. It will have to continue to do this.

Don't store the next service data *AT ALL* in any table.

Instead, calculate it dynamically in a Query, or in the control source of a
form or report textbox.

If the service interval (in integer months) is stored in a field
ServiceInterval, use a calculated field

NextService: DateAdd("m", [ServiceInterval], DMax("[ServiceDate]",
"[Servicetablename]", "[CustomerID] = " & [CustomerID])

John W. Vinson [MVP]
 
Top