can someone tell me the correct way to input a date field in mysql? it may be my cf, but it seems like it works differently every stinkin time.
i have three fields in the table, id(int, pk, autoincrement), itemnum(int), and expirationdate(date),
here is my code:
and heres the error i get:Code:<cfquery name="InsertRecord" Datasource="#Variables.Datasource#"> INSERT INTO #Variables.TableName# (ItemNum, ExpirationDate) VALUES (#Arguments.ItemNum#, #CreateODBCDate(Arguments.ExpirationDate)# </cfquery>
any help at all will be greatly appreciated. and for the record i tried it with single quotes around the date field and it bombs there too.Code: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 '' at line 2 The error occurred in C:\Inetpub\wwwroot\cb\www\Manage\cfcs\NewReleases.cfc: line 79 Called from C:\Inetpub\wwwroot\cb\www\Manage\products\newreleases.cfm: line 13 Called from C:\Inetpub\wwwroot\cb\www\Manage\cfcs\NewReleases.cfc: line 79 Called from C:\Inetpub\wwwroot\cb\www\Manage\products\newreleases.cfm: line 13 77 : <cfquery name="InsertRecord" Datasource="#Variables.Datasource#"> 78 : INSERT INTO #Variables.TableName# (ItemNum, ExpirationDate) 79 : VALUES (#Arguments.ItemNum#, #CreateODBCDate(Arguments.ExpirationDate)# 80 : </cfquery> 81 : <!--- <cfcatch type="any"> SQL INSERT INTO NewReleases (ItemNum, ExpirationDate) VALUES (5599, {d '2008-01-01'} DATASOURCE VENDORERRORCODE 1064 SQLSTATE 42000




Bookmarks