Getting sum for dynamic columns in crosstab query (1 Viewer)

BatoBig

New member
Local time
Today, 05:08
Joined
Apr 28, 2021
Messages
2
Hi,
I have a problem I cannot resolve.
In database I have table showing invoices for fuel based on company cars ID and date of invoice.
Then I created crosstab query to show this data per months with all months sum for each car ID (like in attachment CrossTab Query result).
Then created a form with subform based on crosstab query showing dynamic columns for months (jan, feb,..etc), also based on some main form criteria.
What I need is to get totals for each month from this subform dynamic columns, so I can show them in report based on this subform.
Thanks
 

Attachments

  • CrossTab Query result.png
    CrossTab Query result.png
    7.6 KB · Views: 14

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 23:08
Joined
May 21, 2018
Messages
5,037
Below those columns in the footer put unbound controls. Then in each the control source is
=Sum([MonthNameHere])
 

BatoBig

New member
Local time
Today, 05:08
Joined
Apr 28, 2021
Messages
2
Thanks,
that was solution.
 

arnelgp

error reading drive A:
Local time
Today, 11:08
Joined
May 7, 2009
Messages
12,825
you can make your Crosstab have a "fixed" (query Crosstab) column instead of dynamic.
then create another query (CrosstabSum query) that will sum each month total.
you can use Dlookup() on your report.
 

Attachments

  • car.accdb
    1.3 MB · Views: 20

Users who are viewing this thread

Top Bottom