in reply to Re: Sum fields in Array
in thread Sum fields in Array

Hey Jethro, I tried what you suggested and it worked. I used the 2nd part of you suggested. Is the code ( $sumcredits{$company}+= $credits;) the same as a group by in SQL? Thanks for you help again because I thought it was going to be a real pain to do this. Dave

Replies are listed 'Best First'.
Re^3: Sum fields in Array
by drodinthe559 (Monk) on Feb 04, 2010 at 21:01 UTC
    Here's another question for you. How can I take out a comma in a money field? It doesn't like it when it adds them up.

      Yes, that is similar to SQLs group by.

      Do you mean commas that are used as decimal points (done in some parts of the world, for example Germany), or commas as separators for every 10^3 step?

      In the first case you might substitute the comma with a decimal point ( $num=~s/,/./;), in the second case you might remove all the commas before counting ( $num=~s/,//g; the g means global, do it to all commas, not just one)