<CFQUERY NAME="INSOBJ"
         DATASOURCE="uspc">
INSERT INTO t_sectest
                        (cal_date_start,
                        cal_date_end)
VALUES ('#CreateODBCDate(form.cal_date_start)#',
        '#CreateODBCDate(form.cal_date_end)#')

</cfquery>
-----Original Message-----
From: Mark Leder [mailto:[EMAIL PROTECTED]]
Sent: 02 January 2002 15:54
To: CF-Talk
Subject: Insert Date/Time Format into MS Access DB


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

Reply via email to