Mysql added datetime
Mysql added datetime
When I sent this to a datetime field: date ''2014-11-09 12:08:43'' this will work. But what should I sent to take the server time of my mysql server?
Re: Mysql added datetime
I would like to have the mysql server time if that is not possible sent the client time.
When I take the client time like this:
' + QuotedStr(Datetostr(Date) +' '+ timetostr(now))+ ' for instead of ''2014-11-09 12:08:43''
It doesn't work.
How can I fix this ??
When I take the client time like this:
' + QuotedStr(Datetostr(Date) +' '+ timetostr(now))+ ' for instead of ''2014-11-09 12:08:43''
It doesn't work.
How can I fix this ??
Re: Mysql added datetime
To set client time in a SQL query, you can use the following code:
To get the current time of a MySQL server, you can use the following SQL query:
Code: Select all
QuotedStr(FormatDateTime('yyyy-mm-dd hh:mm:ss',Now))Code: Select all
Select Now()Re: Mysql added datetime
hmm maybe I am doing something wrong.
It doesn't work.
UniConnection1.ExecSQL('INSERT INTO `test` (`TEMP`, `DATE & TIME`) VALUES (''14.2C'', QuotedStr(Select Now()) );');
How to get the Select Now() to work ?
It doesn't work.
UniConnection1.ExecSQL('INSERT INTO `test` (`TEMP`, `DATE & TIME`) VALUES (''14.2C'', QuotedStr(Select Now()) );');
How to get the Select Now() to work ?
Re: Mysql added datetime
To solve the problem, please try using the following code:
Code: Select all
UniConnection1.ExecSQL('INSERT INTO test (`TEMP`, `DATE & TIME`) VALUES (''14.2C'', Now())');Re: Mysql added datetime
It is good to see that the problem has been solved.
Feel free to contact us if you have any further questions.
Feel free to contact us if you have any further questions.