Link to home
Start Free TrialLog in
Avatar of diecasthft
diecasthft

asked on

Working with null values and CFIF

I have a question regarding null values. I have a data table, and that table has a few fields, some have data, some don't. What I'm trying to do is a cfif statement in a cfm page that if the databae query returns nothing for this specific field, then I want the web page to look a certain way, but if the query returned a value of 0 or greater, than I want the web page to look like something else. I thought I could do <cfif #CUMULATIVE_OM# IS NULL> but that doesn't work.....and if I put 0 in there instead of NULL, that doesn't work either, because there is nothing in the specific field. Any help would be greatly appreciated!!!
Avatar of trailblazzyr55
trailblazzyr55

give this a try...

<cfif len(trim(CUMULATIVE_OM))>    

basically this is saying if this variable has anything other than "" then do something...
I should say the statement means that if there's any value to "CUMULATIVE_OM" then it will do something, basically it checks to make sure there's a value..
ASKER CERTIFIED SOLUTION
Avatar of trailblazzyr55
trailblazzyr55

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of diecasthft

ASKER

Exactly what I needed...thanks alot!!!!