yes, you can do this:
#ArraySum(ListToArray(ValueList(q.DateDifference)))#
Note that I removed the space from your [Date Difference] alias to make it a
valid ColdFusion variable.
HTH
- John Whish
> Hi, new to this forum and ColdFusion. I have the following cfquery:
>
> <cfquery name="q" datasource="#******#">
> SELECT id,
> date_leave_start,
> date_leave_end,
> DATEDIFF(DAY, date_start, date_end) + 1 AS [Date Difference]
> FROM tbl
> GROUP BY id, date_start, date_end
> </cfquery>
>
> This returns a recordset and I then need to sum the [Date Difference]
> field to find the total days. It's easy to do this in SQL Server but
> then I would need to write a second sql statement and hit the database
> again. Is there a way I can do this in ColdFusion?
>
> Thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3790
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15