AnggaLisdiyanto
Programmer
- Sep 4, 2012
- 1
Assalamu'alaikum,
I've run this query in sql server and it's works. But not works in mysql at DBMS such as sqlyog and phpmyadmin. This is my query :
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SELECT COUNT(mydate) AS number, CONVERT(VARCHAR(10), GETDATE(10) mydate, 101) AS mydate
FROM sale WHERE CONVERT(VARCHAR(10), mydate, 101) = CONVERT(VARCHAR(10), GETDATE(), 101)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
And this is error message at mysql DBMS :
_________________________________________________________________________________
Error Code: 1064
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 'VARCHAR(10), GETDATE(10) mydate, 101) AS mydate
FROM sale WHERE CONVERT(' at line 1
_________________________________________________________________________________
I hope there are anyone whocan help me. I would be very happy. Thankyou.
I've run this query in sql server and it's works. But not works in mysql at DBMS such as sqlyog and phpmyadmin. This is my query :
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SELECT COUNT(mydate) AS number, CONVERT(VARCHAR(10), GETDATE(10) mydate, 101) AS mydate
FROM sale WHERE CONVERT(VARCHAR(10), mydate, 101) = CONVERT(VARCHAR(10), GETDATE(), 101)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
And this is error message at mysql DBMS :
_________________________________________________________________________________
Error Code: 1064
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 'VARCHAR(10), GETDATE(10) mydate, 101) AS mydate
FROM sale WHERE CONVERT(' at line 1
_________________________________________________________________________________
I hope there are anyone whocan help me. I would be very happy. Thankyou.