Here's a way to return 1 or 0 using find() or findNoCase(). I ran into this when I wanted to update a field in my database that took a 1 or 0.
SET HasSunroof = <cfqueryparam cfsqltype="cf_sql_tinyint" value="#min(1, findNoCase('sunroof', form.carDescription)#">
min() returns the lesser of two numbers. So, if "sunroof" is not found, 0 is returned, otherwise, 1 is returned.
Not the best example, but you get the point.
Tuesday, March 25, 2008
Subscribe to:
Posts (Atom)