Totals: Group By & Multiply in a Report (1 Viewer)

Tskutnik

Registered User.
Local time
Today, 11:02
Joined
Sep 15, 2012
Messages
229
OK - so there is no Multiply option in a report for a series of values (same concept as Sum). I have a range of unitized values that need to be multiplied together.

Well known issue but I can't find a straight answer out there.

Any ideas?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:02
Joined
Oct 29, 2018
Messages
21,359
Hi. Not sure I understand. Are you saying you want to multiply multiple columns? There is a Sum() function, but I'm not sure what you are talking about here.
 

Tskutnik

Registered User.
Local time
Today, 11:02
Joined
Sep 15, 2012
Messages
229
In The Totals function in a report (or a query) you can Group / Sum / Max, Min, etc .... but you can't Multiply. I need Multiply and cant find a work around
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:02
Joined
Oct 29, 2018
Messages
21,359
In The Totals function in a report (or a query) you can Group / Sum / Max, Min, etc .... but you can't Multiply. I need Multiply and cant find a work around
Oh, I see. You realize that could easily create a memory overflow right? You said it's a well known issue, but I've never heard of anyone asked for it before. I once heard someone ask for a Diff(), which I created, but not Multiply because it can easily result in a very (too) large number and cause an error. If you really want it, it's not hard to create one.
 

Tskutnik

Registered User.
Local time
Today, 11:02
Joined
Sep 15, 2012
Messages
229
I need it, yes. These are unitized values and are all between about +0.5 and +1.9 so I don't worry too much about odd results.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:02
Joined
Oct 29, 2018
Messages
21,359
I need it, yes. These are unitized values and are all between about +0.5 and +1.9 so I don't worry too much about odd results.
Okay, if you haven't come up with one of your own by the time I get back in front of a computer, I'll give it a try.

Sent from phone...
 

Tskutnik

Registered User.
Local time
Today, 11:02
Joined
Sep 15, 2012
Messages
229
Thank you very much. I really appreciate your time.
 

Tskutnik

Registered User.
Local time
Today, 11:02
Joined
Sep 15, 2012
Messages
229
I just took a look. I don't think that is what I need but I do expect some sort of VBA code is the answer. Unfortunately I'm not a coder.
To make this as clear as possible, the attached spreadsheet is what I need the math to do. See the highlighted column.
 

Attachments

  • Product.zip
    9.9 KB · Views: 118

theDBguy

I’m here to help
Staff member
Local time
Today, 08:02
Joined
Oct 29, 2018
Messages
21,359
I just took a look. I don't think that is what I need but I do expect some sort of VBA code is the answer. Unfortunately I'm not a coder.
To make this as clear as possible, the attached spreadsheet is what I need the math to do. See the highlighted column.
Hi. The code I posted was meant to be an example rather than a solution. I was hoping it would inspire you to try creating your own Multiply function after seeing how to grab all the records to calculate in the sample code. Sorry if I misled you.
 

Tskutnik

Registered User.
Local time
Today, 11:02
Joined
Sep 15, 2012
Messages
229
Hi. The code I posted was meant to be an example rather than a solution. I was hoping it would inspire you to try creating your own Multiply function after seeing how to grab all the records to calculate in the sample code. Sorry if I misled you.
Got it. Thanks. Let me take another look
 

inke01

New member
Local time
Today, 16:02
Joined
Aug 10, 2020
Messages
15
Hy to everyone i'm stuck lets say with same problem in my database.
I can upload one simply db to show u where i have problem.
There is one form, query and report.
On form are two texbox with date picker
one combobox
and one button
and they are connected with query etc. [Forms]![frm_test]![combo_test] - for users
Between [Forms]![frm_test]![datefrom] and [Forms]![frm_test]![dateto]
Button is set up to open query and report docmd.open......
And i have function written to multiply all values from same field called somatske_stanice
But after i add the filters it returns error 3061 to fiew parameters. expected 1.
with no filters it multiplys all values in that field.
Here is simply db.
 

Attachments

  • New Microsoft Access Database (2).accdb
    3.4 MB · Views: 89

theDBguy

I’m here to help
Staff member
Local time
Today, 08:02
Joined
Oct 29, 2018
Messages
21,359
Hy to everyone i'm stuck lets say with same problem in my database.
I can upload one simply db to show u where i have problem.
There is one form, query and report.
On form are two texbox with date picker
one combobox
and one button
and they are connected with query etc. [Forms]![frm_test]![combo_test] - for users
Between [Forms]![frm_test]![datefrom] and [Forms]![frm_test]![dateto]
Button is set up to open query and report docmd.open......
And i have function written to multiply all values from same field called somatske_stanice
But after i add the filters it returns error 3061 to fiew parameters. expected 1.
with no filters it multiplys all values in that field.
Here is simply db.
Hi. Welcome to AWF!

You should start your own thread to avoid hijacking this one.
 

Users who are viewing this thread

Top Bottom