Ask a Question related to Coldfusion Database Access, Design and Development.
-
khotwheels #1
inserting date into MySql Database
I am trying to insert the current date into a MySql database. I know that the
date format for MySql is yyyy-mm-dd . So far I have tried to insert it like
this:
<cfquery datasource="xxx" username="xxx" password="xxx">
INSERT INTO Time (Time)
VALUES ('#CreateODBCDate(yyyy,mm,dd)#' )
</cfquery>
The error I get is that the function takes one parameter.
Any help someone could offer would be much apreciated.
khotwheels Guest
-
Best Method to insert a Date into a MySQL database?
Dear all, I would like to know which is the best method to insert date into a field in a table of a MySQL database and be able in the future to... -
Trouble inserting date into database
The date format in the form being submitted is mm/dd/yyyy. Below is the error I'm getting. Any help would make me really happy! Thanks Error... -
Inserting Current Date into MySQL Database
OK, I am a complete Newbie at this, well... almost... I am creating a database that accepts members. I need to know how to insert the date of... -
inserting the current date into mysql database fild
Hi I'm using DW MX and the php_mysql server model I have generated this code for inserting data into the DB. <code> if... -
inserting date
Use the Date function. In your query, it would be something like SELECT Field1, Field2, Date() FROM MyTable For the text box, you'd set its... -
SafariTECH #2
Re: inserting date into MySql Database
#CreateODBCDate("#NOW()#")#
It takes an existing date and makes a properly formatted date for an ODBC
compliant database, so long as you are inserting it into an actual date field
in the DB it should work
SafariTECH Guest
-
khotwheels #3
Re: inserting date into MySql Database
I am trying to insert the date (yyyy-mm-dd) not time. I should have named the
field differently. I did try your suggestion and it gave me the following
error.
Error Executing Database Query - Syntax error or access violation: You have
an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near '2005-09-01'}')' at line 3
I thought perhaps I should take out the hash symbols surrounding the NOW
function but it gave me the same error.
khotwheels Guest
-
khotwheels #4
Re: inserting date into MySql Database
I took the quotes out around the hash symbols and it worked. Thank you very much for your help.
khotwheels Guest



Reply With Quote

