Nick, As far as I know, ColdFusion queries do not have NULL values. NULLs come over from the SQL server as empty string. What you should probably do is make sure that awardPoints and pointsRedeemed are NEVER null when coming back form the DB, that way, you won't have to worry about the SUM on the ColdFusion end:
SELECT ( ISNULL( awardPoints, 0 ) ) AS awardPoints, ( ISNULL( pointsRedeemed, 0 ) ) AS pointsRedeemed, FROM [table] ....................... Ben Nadel Web Developer Nylon Technology 350 7th Avenue Floor 10 New York, NY 10001 212.691.1134 x 14 212.691.3477 fax www.nylontechnology.com "Some people call me the space cowboy. Some people call me the gangster of love." -----Original Message----- From: Nick Tong - TalkWebSolutions.co.uk [mailto:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 10:38 AM To: CF-Talk Subject: IFNULL in QoQ Can you use the IFNULL statement is QoQ: i.e. SELECT IFNULL( SUM( awardPoints - pointsRedeemed ) , 0) AS Points FROM qryTmp.memberPoints.orderedMemberData i get this errro: Error Executing Database Query. Query Of Queries syntax error. Encountered "(. Incorrect Select Statement, Expecting a 'FROM', but encountered '(' instead, A select statement should have a 'FROM' construct. TIA -- Nick Tong web: http://talkwebsolutions.co.uk blog: http://succor.co.uk short urls: http://wapurl.co.uk linkedin: http://linkedin.com/pub/0/a70/502 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:245128 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54