Looping over a Query Set as an Array
ColdFusionOne day, not too long ago, my buddy Fro showed me a cool way to sum up values of a query set using the arraySum function in ColdFusion. Say you have a query that returns all of your baseball cards and their respective values. Well in this example you can do something like this
arraySum(qGetCards['cardValue'])
That function will sum up all of the "cardValue" values returned from the query.
What I ran into today was the fact that I didn't want to add up all the values, just part of them. For this I wrote the following script. It is looping through a query and only summing the amount where there is no expirationDate.
Hope this helps someone, somewhere!
Good Day,
Ryan






Loading....