Skip navigation links

MySQL Forums :: Newbie :: Pervasive.SQL to MySQL CONVERT syntax


Advanced Search

Pervasive.SQL to MySQL CONVERT syntax
Posted by: william yee ()
Date: May 08, 2007 07:11PM

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?

Options: ReplyQuote


Subject Written By Posted
Pervasive.SQL to MySQL CONVERT syntax william yee 05/08/2007 07:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.