If your form field is a text field your cfparam will never fire because
form.datasend does exist it is just blank. You could test like:

<cfif not len(form.sateofsend)>
    <cfset  form.dateofsend="01/01/2000">
</cfif>

----- Original Message -----
From: "Mark Leder" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, January 15, 2002 7:14 PM
Subject: CFParam for Date/Time Value


> I have a form where a user has the option of plugging in a date, such as
> 01/15/2002.  If they do enter in the date, the processing page posts it to
> the Access db, no problem.
>
> However, when the person chooses not to enter a date (it's optional), I
> wrote the following CFParam statement to handle it:
>
> <CFPARAM NAME="form.dateofsend" DEFAULT="01/01/2000">
> <cflock timeout="10" throwontimeout="No" type="EXCLUSIVE" NAME="emailadd">
> <CFQUERY NAME="INSOBJ"
>          DATASOURCE="uspc"
>          DBTYPE="ODBC">
> INSERT INTO t_msg (dateofsend)
> VALUES (###form.dateofsend###)
> </CFQUERY>
> </cflock>
>
> However, when I do this, I consistently get the following error message,
> regardless of setting the VALUES using ### or CreateODBCDate.
>
> ODBC Error Code = 37000 (Syntax error or access violation)
> [Microsoft][ODBC Microsoft Access Driver] Syntax error in date in query
> expression '##'.
>
> How do I solve this?  Thanks in advance.
>
> Mark
> 
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to