Need help with calculating dates in records

M

mivan002

I have a form which has a schd_to, actl_to, Dday (a field for the number of
days between the schd and the actl) and other not important fields. So i'm
doing the DateDiff formula to get the difference between the schd and actl
dates which goes in the Dday field, but now I need for the next record in the
form to take it's schd_to date and either add or subtract the previous
record's Dday and update with that new date. Also, I would need for all the
following schd_to dates that do not have actl_to or Dday fields filled out to
update by either adding or subtracting from the last Dday that was calculated.

Thank you in advance.
 
J

John W. Vinson

I have a form which has a schd_to, actl_to, Dday (a field for the number of
days between the schd and the actl) and other not important fields. So i'm
doing the DateDiff formula to get the difference between the schd and actl
dates which goes in the Dday field, but now I need for the next record in the
form to take it's schd_to date and either add or subtract the previous
record's Dday and update with that new date. Also, I would need for all the
following schd_to dates that do not have actl_to or Dday fields filled out to
update by either adding or subtracting from the last Dday that was calculated.

Thank you in advance.

I'm sorry, but I've read this a couple of times and I simply don't understand,
especially the stuff about the next record.

It appears that you're storing calculated fields. If you have both the two
datefields, then in general you should NOT store the difference in days; it
can and should be calculated when needed. Otherwise you could get anomalies
such as the schd_to date being #3/5/2010#, actl_to being #3/10/2010#, and Dday
being 36. SOMETHING'S wrong but you can't tell if Dday was overwritten or one
of the date fields was changed.

Please give a couple or three records of example data, and explain what the
user actually enters and what needs to be derived.
 
M

mivan002

I appologize, hope this explanation will be better.
So the Form has:
-Title field that just has a list box containing titles that the users
choose from and once a title is chosen the schd_to date is preloaded for them.
-Schd_To field that comes from a table and does Not get modified by the
user, it is not enabled for them.
-Actl_To field that the user does enter a date into and once they tab over
to any other field:
-Dday field that calculates the difference between schd_to and actl_to. This
field is actually not stored in any tables, it just calculates the
difference and stays on the form.

So you get, first record displays:
Title: Test (user chooses from list)
schd_to: 3/20/10 (preloaded)
actl_to: 3/25/10 (user inputs)
Dday: -5 (calculated)

Second record displays:
Title: Test2
schd_to: 4/15/10 (once the above actl_to is entered and get the Dday, this
date should show up as 4/10/10, because it took it's schd_to and subtracted
prev Dday)
actl_to: 4/25/10
Dday: 10

Basically this is kind of like a milestone form where the schd_to date goes
off of the title and the titles go in order. What I need it to do is once
the actl_to date is filled in and the user gets a Dday number, the next
record in line needs to take that Dday and either subtract or add it to it's
schd_to date and all below schd_to dates should do the same. I hope this
explained it more.

Thanks again.
 
M

mivan002

I appologize, hope this explanation will be better.
So the Form has:
-Title field that just has a list box containing titles that the users
choose from and once a title is chosen the schd_to date is preloaded for them.
-Schd_To field that comes from a table and does Not get modified by the
user, it is not enabled for them.
-Actl_To field that the user does enter a date into and once they tab over
to any other field:
-Dday field that calculates the difference between schd_to and actl_to. This
field is actually not stored in any tables, it just calculates the
difference and stays on the form.

So you get, first record displays:
Title: Test (user chooses from list)
schd_to: 3/20/10 (preloaded)
actl_to: 3/25/10 (user inputs)
Dday: -5 (calculated)

Second record displays:
Title: Test2
schd_to: 4/15/10 (once the above actl_to is entered and get the Dday, this
date should show up as 4/10/10, because it took it's schd_to and subtracted
prev Dday)
actl_to: 4/25/10
Dday: 10

Basically this is kind of like a milestone form where the schd_to date goes
off of the title and the titles go in order. What I need it to do is once
the actl_to date is filled in and the user gets a Dday number, the next
record in line needs to take that Dday and either subtract or add it to it's
schd_to date and all below schd_to dates should do the same. I hope this
explained it more.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top