Tuesday, January 12, 2010

ColdFusion - Getting the total for a query column

Here's how to get the total for any number column in a query without using loops:
total = arraysum(listtoarray(valuelist(query.column)));

2 comments:

  1. THANK YOU!! This saved me a lot of loopiness.

    ReplyDelete
  2. Yeah man, so elegant, thanks!!
    Sick of summing stuff up "manually"

    ReplyDelete