Sum of sorted values in subreport

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

Guest

Hi everyone
This is my headace:
Have a subreport based on a qry with values sorted by staus, approved and
not approved.
In the footer of the subreport i will use a formula in a text box to
calculate sum of prices for each of approved and not approved. Can i use Dsum
and do somthing like this for approved:

=DSum("[avanse pr firma-eppriser]![eppriser]";"[avanse pr
firma-eppriser]";"[Status]='Godkjente tillegg'")

where
"avanse pr firma-eppriser" is the subreport
"eppriser" is the the price field i want to sum
"status" is the criteria the the values are sorted by in the qry.

It dont work for me, only get error message. What do I do wrong?
 
I only get an error message. Checked out fieldnames and other obvious source
of errors.
--
TomH


Duane Hookom skrev:
I think you can use:
=Sum( Abs([Status]="Godkjente tillegg") * [eppriser])

--
Duane Hookom
MS Access MVP
--

TomH said:
Hi everyone
This is my headace:
Have a subreport based on a qry with values sorted by staus, approved and
not approved.
In the footer of the subreport i will use a formula in a text box to
calculate sum of prices for each of approved and not approved. Can i use
Dsum
and do somthing like this for approved:

=DSum("[avanse pr firma-eppriser]![eppriser]";"[avanse pr
firma-eppriser]";"[Status]='Godkjente tillegg'")

where
"avanse pr firma-eppriser" is the subreport
"eppriser" is the the price field i want to sum
"status" is the criteria the the values are sorted by in the qry.

It dont work for me, only get error message. What do I do wrong?
 
What is your error message?
Do you have fields Status and eppriser in your report's record source?
What section is the text box in?
Is the name of the text box not also the name of a field?

--
Duane Hookom
MS Access MVP
--

TomH said:
I only get an error message. Checked out fieldnames and other obvious
source
of errors.
--
TomH


Duane Hookom skrev:
I think you can use:
=Sum( Abs([Status]="Godkjente tillegg") * [eppriser])

--
Duane Hookom
MS Access MVP
--

TomH said:
Hi everyone
This is my headace:
Have a subreport based on a qry with values sorted by staus, approved
and
not approved.
In the footer of the subreport i will use a formula in a text box to
calculate sum of prices for each of approved and not approved. Can i
use
Dsum
and do somthing like this for approved:

=DSum("[avanse pr firma-eppriser]![eppriser]";"[avanse pr
firma-eppriser]";"[Status]='Godkjente tillegg'")

where
"avanse pr firma-eppriser" is the subreport
"eppriser" is the the price field i want to sum
"status" is the criteria the the values are sorted by in the qry.

It dont work for me, only get error message. What do I do wrong?
 
Thanks, you lead me in the right dirction. Take me some time, but this is
what i do wrong: first, text box where placed in page footer, not report
footer. Second, used the name of controller i formula, not controlsource.
Third, approved and not approved use the ID in the table. The expression
ended like this:
=Sum(Abs([Status]=3 Or 4)*[sumaveppriser]). Works fine.
But as known, one problem solved makes another.
Now i cant get the sum of prices for "approved" and "not approved" from the
subreport to main reportfooter. Tried to get the sum directly with refering
to the expression shown above, but no. I only get the sum of "not approved".
is there a way too do it simply?
Must mention that the values in the main report for each of approved and not
approved is shown, but icant even refer to them and get a sum.
 
I read some post here and find out i can use running sum, overall , it work.
I now have the total of prices and everything seems fine so far.
Thank you anyway for great help.
 
This expression should not work
=Sum(Abs([Status]=3 Or 4)*[sumaveppriser])
Your expression [Status]=3 Or 4 will always return true. You would need to
use
=Sum(Abs([Status]=3 Or [Status]= 4)*[sumaveppriser])
 
Back
Top