> <CFQUER datasource="mydbsource">
> INSERT INTO TABLENAME (Field1, Field2, Field3,....)
> VALUES ('Value1', 'Value2', 'Value3',...)
> </CFQUERY>
>
> Is that the proper syntax?
> Sp Field1 is a date got from the form how would I make sure it is
> inserted in a format I like? Can I do a dateformat within the query?
> I am getting a syntax error!
Dates have to be inserted as ODBCDateTime format. You format dates on
output, not on database insert. In addition, you've got "cfquer" versus
"cfquery" and you aren't #... # (pounding) your variables in the code above.
Here's a better example:
<CFQUERY name="AddIn" datasource="mydbsource">
INSERT INTO TABLENAME (DateField, CharField, NumField,....)
VALUES (#CreatODBCDateTime(Value1)#, '#Value2#', #Value3#,...)
</CFQUERY>
HTH
Hatton Humphrey
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
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