inter Posted September 22, 2005 Posted September 22, 2005 Hello, I have an insert query that works on mysql and another delete statement that doesn't seem to work when executing on mysql..... the problem is with the datetime I think..... this works: sql = "insert into tblchat (tijd, tekst, naam) values (str_to_date('" & now & "','%d/%m/%Y %H:%i:%s'),'" & gesplitst(0) & "','" & gesplitst(1) & "')" this doesn't work: sql = "delete * from tblchat where tijd < STR_TO_DATE('" & dateadd("s",-5,now) & "','%d/%m/%Y %H:%i:%s') " I don't understand why...Is the delete statement wrong syntax???? greets, Inter EDIT: this code did work on an access database but instead of STR_TO_DATE I used cdate. Quote
kejpa Posted September 22, 2005 Posted September 22, 2005 Hi, when my SQL don't work as I was hoping for when building the string I always prints the resulting string (ie sql), copies it to an open GUI of the database where I run the query. It has two advantages, 1. when the sql is printed you can clearly see what's supposed to happen and solve many problems there 2. The database GUI gives you additional information about the query (I know you can print mysql_error in your app, but somehow it's more obvious in the GUI) HTH /Kejpa Quote
inter Posted September 22, 2005 Author Posted September 22, 2005 already solved it... thx. that is the way I did it too ;-) no * in the delete statement ;-) Quote
inter Posted September 22, 2005 Author Posted September 22, 2005 what is the best free GUI for mysql anyway ? Quote
kejpa Posted September 23, 2005 Posted September 23, 2005 what is the best free GUI for mysql anyway ? Best I'm not sure of but I like SQLYog alot. Check out Webyog home page mySQL Ab is providing a free tool MySQLCC (MySQL Control Center) which I have installed but not used very much. /Kejpa Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.