Hi all, I'm using the SUM operator to get the total expenditure in an account. As you can see below, in the same query I'm getting other data from the same table:
SELECT a.accountID, a.accountName, a.accountDebits, SUM(a.accountDebits) AS TotalSpent FROM account_tb a WHERE a.accountID = 222222 ....but CF tells me: "You tried to execute a query that does not include the specified expression 'accountID' as part of an aggregate function." My only solution so far has been to execute the SUM operator in a separate query. So my question is: can we use SUM within a general query that gets other data too, or does SUM have to go in its own query? If the first, how shoulw I modify the code above for SUM and the other fields to coexist? I'm using CFMX 6 and MS Access. Thanks, Roberto Perez ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:250399 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

