Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting SUM of Textbox 1

Status
Not open for further replies.

ousoonerjoe

Programmer
Jun 12, 2007
925
US
I need to do a =SUM(Textbox99), but unfortunately, I can't seem to do such a simple and straight forward task. What do i need to do to be able to do the above?

Any and all suggestions are welcome. Thank you.

--------------------------------------------------
Bluto: What? Over? Did you say "over"? Nothing is over until we decide it is! Was it over when the Germans bombed Pearl Harbor? No!
Otter: Germans?
Boon: Forget it, he's rolling.
--------------------------------------------------
 
Not an option... the data is coming from a mainframe so i'm getting repeating values in some fields which in turns causes the SUM to be way over expected result.

--------------------------------------------------
Bluto: What? Over? Did you say "over"? Nothing is over until we decide it is! Was it over when the Germans bombed Pearl Harbor? No!
Otter: Germans?
Boon: Forget it, he's rolling.
--------------------------------------------------
 
Well, you can't expect to SUM values together and return a different result than their total summation. If you're not truly looking for a SUM of the displayed values, then you need to alter your SUM expression to something else.

What is the expression in your source TextBox? It must be something other than =Fields!SomeField.Value. Maybe it's in a group header, and you have =First(Fields!SomeField.Value) and you want to total only those First records. Maybe it's something else?
 
i'm having to do some hiding of the 'duplicate' values on the report. All i need is to SUM the Invoice Amounts that are shown.

The criteria would be DISTINCT(InvoiceNumber, InvoiceAmount)

That would give me the numbers i'm looking for to generate a Grand Total. Normally it would be pretty straight forward, but this mainframe data is throwing me off.

--------------------------------------------------
Bluto: What? Over? Did you say "over"? Nothing is over until we decide it is! Was it over when the Germans bombed Pearl Harbor? No!
Otter: Germans?
Boon: Forget it, he's rolling.
--------------------------------------------------
 
Riverguy,

Can you access the mainframe data with a query that returns DISTINCT data rows? If so, the dups will disappear from the resultant dataset.
 
i found a solution. Altered the query to push into a temp table with an extra field. Then i updated the field with the SUM criteria i needed to get around the duplicates. On the report all i have to do is reference the FIRST(InvTotal) to display the results as needed.

It's not the prettiest way, but it works.

I would still like to see a way to reference the Text boxes directly. There have been several times where it would have been easier to hit a text box than to modify queries, or in some cases, change the entire report around to get the fields in places where i can do some aggregate functions on the fields.

--------------------------------------------------
Bluto: What? Over? Did you say "over"? Nothing is over until we decide it is! Was it over when the Germans bombed Pearl Harbor? No!
Otter: Germans?
Boon: Forget it, he's rolling.
--------------------------------------------------
 
=ReportItems!TextboxName.Value

Is how to reference a textbox - I assume you must have it in a list object for there to be more than 1 result so...untested:

=SUM(ReportItems!TextboxName.Value)





Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top