Suming Data in a Calculeted Control

M

Mark Avis

Hello,
I have a filtered form that I have a calculated control on. The control
calculates the differences in days of two dates. How do I get a sum of those
caluclations? Thank you.

Mark Avis
 
A

Allen Browne

Add a control to the Form Footer section.

Set its Control Source to =Sum(xxx), where xxx represents the entire
expression in your calculated control (without the =.)

For example, if your calculated control uses:
=[Date2] - [Date1]
you will use:
=Sum([Date2] - [Date1])
 
M

Mark Avis

Hello,
My calculated control uses
DateDiff("d",[DateReturned],[DateCompleted]). When I use
=sum(DateDiff("d",[txtDateReturned],[DateCompleted])) in the footer I get an
error. Thank you.

Mark Avis

Allen Browne said:
Add a control to the Form Footer section.

Set its Control Source to =Sum(xxx), where xxx represents the entire
expression in your calculated control (without the =.)

For example, if your calculated control uses:
=[Date2] - [Date1]
you will use:
=Sum([Date2] - [Date1])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Mark Avis said:
Hello,
I have a filtered form that I have a calculated control on. The
control
calculates the differences in days of two dates. How do I get a sum of
those
caluclations? Thank you.

Mark Avis

.
 
A

Allen Browne

Form footer, or page footer?

You have a txt prefix in one field name, but not the other? Are both of
these guaranteed to be valid dates (or null), or could the data type be
suspect?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Mark Avis said:
Hello,
My calculated control uses
DateDiff("d",[DateReturned],[DateCompleted]). When I use
=sum(DateDiff("d",[txtDateReturned],[DateCompleted])) in the footer I get
an
error. Thank you.

Mark Avis

Allen Browne said:
Add a control to the Form Footer section.

Set its Control Source to =Sum(xxx), where xxx represents the entire
expression in your calculated control (without the =.)

For example, if your calculated control uses:
=[Date2] - [Date1]
you will use:
=Sum([Date2] - [Date1])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Mark Avis said:
Hello,
I have a filtered form that I have a calculated control on. The
control
calculates the differences in days of two dates. How do I get a sum of
those
caluclations? Thank you.

Mark Avis

.
 

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