Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query conversion from MSSQL to MySQL

Status
Not open for further replies.

Romanichine

Programmer
Apr 9, 2002
30
CA
I am having problems converting the query below, which runs on Microsoft SQL Server, to MySQL.
I already converted ISNULL to IFNULL but still am getting
the following ODBC/MySQL error:

==========
[MERANT][ODBC MySql driver][MySql]You have an error in your SQL syntax near 'INNER JOIN currencies cur ON client.currency_id = cur.currency_id INNER JO' at line 26
==========
SELECT *
FROM valid_sales_ids s
RIGHT OUTER JOIN direct_services
ON s.sales_id = direct_services.sales_id
RIGHT OUTER JOIN client
INNER JOIN currencies cur
ON client.currency_id = cur.currency_id
INNER JOIN languages l
ON client.language_code = l.language_code
INNER JOIN companies
ON client.company_id = companies.company_id
LEFT OUTER JOIN valid_terminations v
ON client.termination_code = v.termination_code
ON direct_services.client_id = client.client_id
WHERE client.client_id = '0003216'
AND SUBSTRING(client.client_type,1,1) = Companies.company_id
AND IFNULL(client.language_code,1) = l.language_code
AND IFNULL(client.currency_id,1) = cur.currency_id
==========

Any help would be appreciated.

--
Roman.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top