Pervasive.SQL to MySQL CONVERT syntax
I've been trying for weeks trying to look for the right MySQL syntax for the following Pervasive.SQL statement.
SELECT LEFT(CONVERT OCLYearMonth,SQL_CHAR,4)+' '+LEFT(MONTHNAME(convert('1900-'+RIGHT(CONVERT(OCLYearMonth,SQL_CHAR),2)+'-01',SQL_DATE)),3) AS YearMnth
,OCLYearMonth,OCLCode,OCLBillNo,OCLORPayment,OCLORNo,OCLORDate,OCLORTeller,OCLModifyby,OCLModifydate
FROM ConsOtherLedger WHERE OCLTown=':1' AND OCLRoute=':2' AND OCLAccount=':3 ' AND OCLCode=':4'
Whenever I execute the above query in MySQL database, it gives me the error below.
Error: 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 y'OCLYearMonth,SQL_CHAR,4)+' '+LEFT(MONTHNAME(convert('1900-'+RIGHT(CONVERT(OCLYea' at line 1 (State:37000, Native Code: 428)
Can anybody help? What the right MySQL statement?