On 6/13/07, James Smith <[EMAIL PROTECTED]> wrote: > > AND ProductGroupID = CASE WHEN @productgroupid > 0 THEN > > @productgroupid ELSE ProductGroupID END > > This is the simplest to read but has a drawback, it the stored > ProductGroupID is null then the statement becomes AND ProductGroupID = > ProductGroupID and for some reason NULL does not equal NULL so the row isn't > returned, is there a workaround for this? >
AND COALESCE(ProductGroupID,0) = CASE WHEN @productgroupid > 0 THEN @productgroupid ELSE COALESCE(ProductGroupID,0) END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:280968 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4