Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Paulie579 #1
Simple Dumb Question - Null for Date/Time Field
using cf mx ms sql 2000. i have an update form that contains a field for date a
procedure was signed. the problem is if the procedure was not signed, the user
doesn't enter anything into the date field. but when they click the update
button the update query inserts 1900-01-01 00:00:00 into the field in the db.
Paulie579 Guest
-
Get current date/time? Use them in hidden field?
I've got an app that works as a reception log for clients coming in our agency. The receptionist logs each client's name into our log database. ... -
Syntax error when trying to update date/time field
I am getting a MS Access ODBC Syntax error (missing operator) in query expression '2006-01-05 09:17:01.0' when I try to execute an update query. On... -
Date/Time field default values!
I'm creating a CF page that keeps track of dates/time of things. I have all my Date/Time fields set-up as Date/Time in access and I use... -
date & time in form field
I want to put the current date and time into a form field which will them be submitted to a database. Is this possible? If so, what code should I... -
Separated date and time or one datetime field
Hi all, I am learning php+mysql and am trying to set up a log database. I wonder if it is better to have 2 different columns for date and time... -
jorgepino #2
Re: Simple Dumb Question - Null for Date/Time Field
inside the update query you could do something like this
<cfif form.updateddate neq "">
Updateddate = '#form.updateddate#'
</cfif>
only when updateddate is fill it would update the date field
jorgepino Guest
-
-
ssawka #4
Re: Simple Dumb Question - Null for Date/Time Field
Another option would be to use the <CFQUERYPARAM> tag. Something like:
<cfset updatedate_null = not IsDate(form.updatedate)>
<cfquery>
update Table
set Updatedate = <cfqueryparma value="#form.updatedate#"
null="#variables.updatedate_null#">
where ...
</cfquery>
That way an actual "null" will be sent if form.updatedate is not a date.
Hope this helps,
Sean
ssawka Guest



Reply With Quote

