Update date field to a Null
Hi everyone,
I have a web page called Quality that has mulitple records on it with multiple people logged into it at the same time updating it.I’m trying to update a date on one field, and it works, but then if I try to clear it out and update it, it doesn’t update it to a Null. When I put in the code to try and update it as a Null in the Update Query, it puts a date of 1/1/00 in the field for some reason and also updates the other blank fields to this date. I have something to account for the Nulls on the drop downs in my other fields. The code I used for those was like this in the Update Query:
Set Approval_Initials = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#Evaluate('form.PDF_Creation_Doc_Control_Approval_Initials#id#')#" null="#NOT len(trim(Evaluate('form.PDF_Creation_Doc_Control_Approval_Initials#id#')))#" />
Do I have to use something like this again for the Date field except with the CF_SQL_DATE tag? Below is what I have for the Date field right now:
<cfif DisplayQualityDate.recordcount>
<cfif isDefined("form.Quality_Date#id#") and evaluate("form.Quality_Date#id#") neq "">
<cfquery Datasource="#application.DataSource#">
Update Approval
Set Approval_Date = '#Evaluate("form.Quality_Date#id#")#'
WHERE APV_ItemID = #id# AND Document_Type = 'Quality'
</cfquery>
</cfif>
</cfif>
Is this enough information? What does the CF_SQL_DATE do exactly? Any help would be greatly appreciated.
Andy
