heh. i suggested coalesce() over isnull() just to keep it portable. but agreed that isnull() is more "readable" than both the CASE and coalesce() suggestions :)
On 10/8/07, Rick Root <[EMAIL PROTECTED]> wrote: > Depending on your database, you could also use ISNULL() or IFNULL() > functions - much simpler than the case statement, but less portable. > > For example, in Microsoft SQL Server: > > http://msdn2.microsoft.com/en-us/library/ms184325.aspx > > The case statement below would look like this instead: > > ISNULL(col,'YOURINDICATORFORNULL) AS col > > Rick > > On 10/8/07, Qasim Rasheed <[EMAIL PROTECTED]> wrote: > > Instead of Stored procedure, you can simply do this > > > > CASE WHEN col is NULL THEN 'YOURINDICATORFORNULL' > > ELSE col > > END AS col > > > > HTH > > > > On 10/8/07, Richard White <[EMAIL PROTECTED]> wrote: > > > > > > perfect, thanks very much charlie :) > > > > > > in relation to the issue of null values being different to empty strings > > > in the database, am i right by saying the only way to get round this would > > > be to create a stored procedure that ran sql code to test for a null value > > > or empty string then pass back a result to cf telling it whether it is > > > null > > > or an empty string? > > > > > > thanks > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290581 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4