[thelist] early mornin' CF/access date tip

Morgan Kelsey morgan at morgankelsey.com
Tue Mar 11 09:51:39 CST 2003


<tip type="coldfusion">
Having trouble inserting a NULL value into an Access date field
using ColdFusion?

Newer versions of Access allow:

INSERT INTO table_name
(date_lastmodified)
VALUES
(<cfqueryparam cfsqltype="CF_SQL_DATE"
value="#Trim(form.l1_fromdate)#">)

But if that throws a mysterious error, you may have to do this:

INSERT INTO table_name
(date_lastmodified)
VALUES
(<cfif Len(Trim(form.l1_fromdate))>
 <cfqueryparam cfsqltype="CF_SQL_DATE"
value="#Trim(form.l1_fromdate)#">
 <cfelse>
 <cfqueryparam cfsqltype="CF_SQL_DATE" null="Yes">
 </cfif>)

</tip>

nagrom
http://www.morgankelsey.com



More information about the thelist mailing list