Access Adding functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im tryin to add three specific length of time in months

currently im using this to determine a length of time and it works(three
separate entrys)
=DateDiff("m",[StartDate],NZ([EndDate],Date()))
=DateDiff("m",[StartDate2],NZ([EndDate2],Date()))
=DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

how can i add the results of each of these formulas into a separate box

all of this is being done on a form in access 2003

thank you
 
=DateDiff("m",[StartDate],NZ([EndDate],Date())) +
DateDiff("m",[StartDate2],NZ([EndDate2],Date())) +
DateDiff("m",[StartDate3],NZ([EndDate3],Date()))
 
thanks its closer-----but the answer shows #Name?
where should i paste this formula? maybe i have it in the wrong place on
the form


Brendan Reynolds said:
=DateDiff("m",[StartDate],NZ([EndDate],Date())) +
DateDiff("m",[StartDate2],NZ([EndDate2],Date())) +
DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

--
Brendan Reynolds

hydegroove13 said:
Im tryin to add three specific length of time in months

currently im using this to determine a length of time and it works(three
separate entrys)
=DateDiff("m",[StartDate],NZ([EndDate],Date()))
=DateDiff("m",[StartDate2],NZ([EndDate2],Date()))
=DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

how can i add the results of each of these formulas into a separate box

all of this is being done on a form in access 2003

thank you
 
In the Control Source property of the text box you want to display the
result. Make sure that the name of the text box is not the same as the name
of any of the fields referred to in the expression.

--
Brendan Reynolds

hydegroove13 said:
thanks its closer-----but the answer shows #Name?
where should i paste this formula? maybe i have it in the wrong place on
the form


Brendan Reynolds said:
=DateDiff("m",[StartDate],NZ([EndDate],Date())) +
DateDiff("m",[StartDate2],NZ([EndDate2],Date())) +
DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

--
Brendan Reynolds

hydegroove13 said:
Im tryin to add three specific length of time in months

currently im using this to determine a length of time and it
works(three
separate entrys)
=DateDiff("m",[StartDate],NZ([EndDate],Date()))
=DateDiff("m",[StartDate2],NZ([EndDate2],Date()))
=DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

how can i add the results of each of these formulas into a separate box

all of this is being done on a form in access 2003

thank you
 
thanks the "same name" thing was the problem -- but it will only calculate
if i have items in each date field
for example this is the layout

start date end date total(in months)
start date2 end date 2 total2
start date3 end date 3 total3

total of all


if i dont have any start and end dates for "2" and "3" if wont calculate the
total of all

some of my clients only have one start/end date--while others have 2 or 3
the idea is to calculate a total tenure for them

i appreciate all your help---access is still very new to me





Brendan Reynolds said:
In the Control Source property of the text box you want to display the
result. Make sure that the name of the text box is not the same as the name
of any of the fields referred to in the expression.

--
Brendan Reynolds

hydegroove13 said:
thanks its closer-----but the answer shows #Name?
where should i paste this formula? maybe i have it in the wrong place on
the form


Brendan Reynolds said:
=DateDiff("m",[StartDate],NZ([EndDate],Date())) +
DateDiff("m",[StartDate2],NZ([EndDate2],Date())) +
DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

--
Brendan Reynolds

Im tryin to add three specific length of time in months

currently im using this to determine a length of time and it
works(three
separate entrys)
=DateDiff("m",[StartDate],NZ([EndDate],Date()))
=DateDiff("m",[StartDate2],NZ([EndDate2],Date()))
=DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

how can i add the results of each of these formulas into a separate box

all of this is being done on a form in access 2003

thank you
 
= NZ(DateDiff("m",[StartDate],NZ([EndDate],Date())),0) +
NZ(DateDiff("m",[StartDate2],NZ([EndDate2],Date())),0) +
NZ(DateDiff("m",[StartDate3],NZ([EndDate3],Date())),0)

--
Brendan Reynolds

hydegroove13 said:
thanks the "same name" thing was the problem -- but it will only
calculate
if i have items in each date field
for example this is the layout

start date end date total(in months)
start date2 end date 2 total2
start date3 end date 3 total3

total of all


if i dont have any start and end dates for "2" and "3" if wont calculate
the
total of all

some of my clients only have one start/end date--while others have 2 or 3
the idea is to calculate a total tenure for them

i appreciate all your help---access is still very new to me





Brendan Reynolds said:
In the Control Source property of the text box you want to display the
result. Make sure that the name of the text box is not the same as the
name
of any of the fields referred to in the expression.

--
Brendan Reynolds

hydegroove13 said:
thanks its closer-----but the answer shows #Name?
where should i paste this formula? maybe i have it in the wrong place
on
the form


:


=DateDiff("m",[StartDate],NZ([EndDate],Date())) +
DateDiff("m",[StartDate2],NZ([EndDate2],Date())) +
DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

--
Brendan Reynolds

message
Im tryin to add three specific length of time in months

currently im using this to determine a length of time and it
works(three
separate entrys)
=DateDiff("m",[StartDate],NZ([EndDate],Date()))
=DateDiff("m",[StartDate2],NZ([EndDate2],Date()))
=DateDiff("m",[StartDate3],NZ([EndDate3],Date()))

how can i add the results of each of these formulas into a separate
box

all of this is being done on a form in access 2003

thank you
 
Back
Top