Getting sum for dynamic columns in crosstab query

BatoBig

New member
Local time
Today, 09:23
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: 597
Below those columns in the footer put unbound controls. Then in each the control source is
=Sum([MonthNameHere])
 
Thanks,
that was solution.
 
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

Users who are viewing this thread

Back
Top Bottom