Query generated in MS access work on linked sybase tables but not on its own - please translate!
Posted on 2004-04-29
I basically have an access database with linked tables to a Sybase DB. I need to use this query in an ASP page, but it won't work. Have also tried in Sybase interactive but still no joy - can anyone help? I know its a problem with the left and right joins, and I'm guessing just a syntax issue, but not sure what.
SELECT FFUsers.Companies.Name, FFUsers.Assignments.title, FFUsers.Assignments.status, FFUsers.Assignments.assign_no, FFUsers.Assignments.consult_2, FFUsers.Invoices.inv_date, FFUsers.Invoices.inv_type, FFUsers.Consultant_Fees.fee_comment, FFUsers.UsersPreferences.User_Long, FFUsers.Consultant_Fees.rate1
FROM (FFUsers.Consultant_Fees LEFT OUTER JOIN (FFUsers.Invoices INNER JOIN (FFUsers.Assignments INNER JOIN FFUsers.Companies ON FFUsers.Assignments.client_company_guid = FFUsers.Companies.Companies_GUID) ON FFUsers.Invoices.assignments_guid = FFUsers.Assignments.Assignments_guid) ON FFUsers.Consultant_Fees.related_invoice_guid = FFUsers.Invoices.invoice_guid) LEFT OUTER JOIN FFUsers.UsersPreferences ON FFUsers.Consultant_Fees.consultant = FFUsers.UsersPreferences.User_Short
WHERE FFUsers.Assignments.status Like 'Open*' AND Year(FFUsers.Invoices.inv_date)=2004 AND FFUsers.Invoices.inv_type Like 'Stage*'
ORDER BY FFUsers.UsersPreferences.User_Long DESC;