[EMAIL PROTECTED] wrote:
>I've got a form where I'm inputting a date value, with the form formatted (in the db)
>as "date/time".
>However, when I try to cfinsert, I'm getting an error - "Form entries incomplete or
>invalid", and then it lists the date I was trying to input.
>There ARE dates in there, b/c I inputted them manually, but it's not letting me input
>it automatically.
>Any thoughts ?
>
>
Try not to use CFINSERT. Its not very bright, so it doesn't cope with a
lot of things.
You have to remember that what you think is a valid date might not be a
valid date for someone else. eg. (I'm guessing here, but you're american
right?) 08/23/2004 in america thats 23rd August 2004, to me in the UK,
there's no such thing as a 23rd month.
I'm guessing, but you're probably using MS Access as the database right?
If thats the case, then the dates need to be transformed into ODBC
Date/Time format before you insert them into your database. See the
functions CreateODBCDate/CreateODBCDateTime.
To do an insert into your database not using CFINSERT you need to use
CFQUERY and a SQL INSERT statement.
eg.
<cfquery name="insert_data" datasource="myDSN">
INSERT INTO myTable (txtColumn, numbColumn, DateTimeColumn)
VALUES ('this is some text to be
inserted',123,#createodbcdatetime(createdate(2004,8,23))#)
</cfquery>
If you're using another database other than Access, then
CreateODBCDateTime may still work, but some databases like dates to be
given to them in their own specific format.
Something else to check. Make sure you haven't used restricted words as
database, table and column names in your database. These are things
like date, time, month, text, string, insert, update, select and so on.
Hope this helps
Regards
Stephen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=38
Message: http://www.houseoffusion.com/lists.cfm/link=i:15:416
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54