Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: SELECT SUM() - help: Edit Log

Here is the list of edits for this post
SELECT SUM() - help
hello!

I'm processing a loop of records and want to get the total sum of a particular column for all of the records.

I want the total to be allocated to $total_asked.

The column I'm after is "asked".

The following code isn't working for me... where it should return a total of 75 the result I'm getting is 556538336.

Code:
for each of my records...

my $cond = GT::SQL::Condition->new(
question_id_fk => '=' => "$_->{'question_id'}"
);

$total_asked += $db->select('SUM(asked)', $cond );

...

Can anyone help?

Thanks

r


edit: just corrected the code

Last edited by:

ryel01: Aug 20, 2004, 1:27 AM

Edit Log: