Any reason to validate before the <cfquery> as some suggested or is it just 
personal preference vs doing in the SQL statement?

** Purely personal, I just like my SQL to look clean. If you have to do this 
for 30 fields, I'd write a quick function:

<cffunction name="CleanupVar" returntype="string">
 <cfargument name="FormValue">
 <cfif FormValue EQ "">
    <cfset NewVal = "Null">
 <cfreturn x>
</cffunction>

and then call it like

<cfquery...

UPDATE MyTable
SET MySmallDateTime = #CleanupVar(form.SmallDateTimeValue)#


I hope that makes sense.



-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------



Reply via email to