Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

incorrect datetime value

Status
Not open for further replies.

Floodster

Technical User
Jan 28, 2005
204
I'm having a problem inserting a date into my table in MySql. I had no problem when I used Access.
My code is;
Code:
INSERT into tbl_LOGIN (user_id, user_Logname, user_login) VALUES (1,'test', now());

When i run this I get the error "Incorrect datetime value :'16/05/2006' for column 'user_login' at row 1". Now I know this has got to be the way the date is being fomratted because when I view the table in MySql the date is formatted '2006-02-05 11:10:01'.
I've tried to GOOGLE this but have not found a specific answer.

Any ideas??
Thanks.
 
the mysql NOW() function does not generate dates in that format, so your problem must originate from elsewhere -- maybe you're using the asp NOW() function?

r937.com | rudy.ca
 
Sorry, yes I am writing my sql statements in .ASP to insert into a MySql database. How can I fix the error?
 
r937,
How do i use it when creating the insert sql in an .ASP page??
thanks for the quick responses.
 
r937,
skip that last reply, I've fixed it.
thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top