Someone mentioned using createodbcdate, which should work fine if you
have your datasource set up as an ODBC datasource.
If you are using access as an OLE datasource, you'll (probably) have to
use Access's native format, which surrounds it by pound signs:
<CFQUERY NAME="INSOBJ"
DATASOURCE="uspc">
INSERT INTO t_sectest
(cal_date_start,
cal_date_end)
VALUES (###form.cal_date_start###,
###form.cal_date_end###)
</cfquery>
At 10:54 AM 01/02/2002 -0500, you wrote:
>I want to insert a date from a form, as MM/DD/YYYY
>I set up an SQL Statement as follows:
>
><CFQUERY NAME="INSOBJ"
> DATASOURCE="uspc">
>INSERT INTO t_sectest
> (cal_date_start,
> cal_date_end)
>VALUES ('#form.cal_date_start#',
> '#form.cal_date_end#')
>
></cfquery>
>
>If I set the MS Access db field as Date/Time, even with a mask of
>99/99/0000;0;_ - it throws a syntax error. (I've tried it with and without
>single quotes surrounding the variable).
>
>If I set the Access db field as Text, it does take the date, but then does
>not sort properly (based on ascending or descending dates).
>
>My question, what is the correct way to format the SQL statement so that I
>can insert the form.cal_date_start as a Date/Time Field in MS Access.
>
>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