• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adding values in a recordset

Explorer ,
Feb 26, 2019 Feb 26, 2019

Copy link to clipboard

Copied

Hi,

I have a recordset with some values in it that I want to add together but I don't know how to do it.  The recordset looks like:

<cfquery name="rsResults" datasource="username" username="value" password="F00tBall">

SELECT *

FROM options

WHERE value_id = '#FORM.value_id#'

</cfquery>

I list the values in a table

<cfoutput query="rsResults">

#rsResults.value#,

</cfoutput>

and I want to add together all the values and display the result but I don't know how to do that.  Can anyone help with this?


Thanks,Mike

Views

304

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Feb 26, 2019 Feb 26, 2019

I found the answer myself.  I used

<cfset total = ArraySum(rsResults['value'])>

Votes

Translate

Translate
Explorer ,
Feb 26, 2019 Feb 26, 2019

Copy link to clipboard

Copied

LATEST

I found the answer myself.  I used

<cfset total = ArraySum(rsResults['value'])>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation