OK... what's the secret?? I have a plain date field in SQLServer. I want it to be blank! If I put in a blank, I get 01/01/00 back (starting date for SQLSever).
I remember having this exact same problem with SQL Server and I kicked myself when I figured it out. You just set the date equal to null. An update query for example:
<cfif Len(FORM.Date) NEQ 0>
Date = #CreateODBCDate(FORM.Date)#,
<cfelse>
Date = null,
</cfif> Andrew
amayer@sonic.net
If that doesn't work, here's another option that i have right in my SQL update statement:
<cfquery NAME="query" DATASOURCE="dsn">
UPDATE tablename
<cfif #FORM.date# IS "">
SET date = Null,
<cfelse>
SET date=#CreateODBCDate(FORM.date)#,
</cfif>
moreValues='#FORM.moreValues#'
</cfquery>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.