> From: Robert Orlini [mailto:[EMAIL PROTECTED] 
> I have a form that if the date field is blank SQL 
> automatically inserts the date of 1/1/1900 and then this displays. 
> How can I have it leave this field blank? The column is set 
> as datetime in design view.

Make sure the field will accept a NULL in the DB. In your query you can then
use cfquery param as follows:

<cfqueryparam 
        cfsqltype="....." 
        value="#Trim(form.someVal)# 
        null="#YesNoFormat(Len(Tim(form.someVal)) GT 0)#"
/>

If the condition in the null attribute returns "Yes" the value in the value
attribute is ignored and NULL is passed in... Else it is used.

Mike




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:191971
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to