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

BatoBig

New member
Local time
Today, 16:39
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: 508

MajP

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

BatoBig

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

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:39
Joined
May 7, 2009
Messages
19,175
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: 548

Users who are viewing this thread

Top Bottom