I have a MySQL query to pull all products from the database, no problem. I am trying to get it to only display prodcuts that are in stock, the value should be "sold < p.quantity" in the following query. however, when sold appears as null (very often) it removes the full record, which I don't want. there has to be an easy way to do this...
Here is my current query: <cfquery name="rsproducts" datasource="#application.db#"> SELECT SUM(o.qty) as sold, p.sku, p.name, p.points, p.short_description, p.quantity, p.image FROM tblproducts as p LEFT JOIN tblorder_list as o ON p.sku=o.sku #can_afford# GROUP BY p.sku </cfquery> Thanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316295 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4