I am working on a database issue and need to resolve this piece of code. Can you or anyone else understand what is happening here? I need to take out certian parts, but if I do, I get syntax errors. How can I remove anything to do with Facility, or department? I don't need these,but the code I am "borrowing" has them in it. Any ideas?
SELECT [valPerson].[PersonName] AS Name, [valPerson].[PersonID] AS ID, [valCompany].[CompanyName], [valCompanyType].[CompanyTypeDescription], [valPerson].[PersonPhoneNumber], [valPerson].[PersonPhoneExt], [valPerson].[PersonEmailAddress1], [valPersonDepartment].[PersonDepartmentDescription], [valPersonFacility].[PersonFacilityDescription] FROM valPersonFacility INNER JOIN (valPersonDepartment INNER JOIN ((valCompanyType INNER JOIN valCompany ON [valCompanyType].[CompanyTypeID]=[valCompany].[CompanyTypeID]) INNER JOIN valPerson ON [valCompany].[CompanyID]=[valPerson].[PersonCompanyID]) ON [valPersonDepartment].[PersonDepartmentID]=[valPerson].[PersonDepartmentID]) ON [valPersonFacility].[PersonFacilityID]=[valPerson].[PersonFacilityID] ORDER BY [valPerson].[PersonName];
SELECT [valPerson].[PersonName] AS Name, [valPerson].[PersonID] AS ID, [valCompany].[CompanyName], [valCompanyType].[CompanyTypeDescription], [valPerson].[PersonPhoneNumber], [valPerson].[PersonPhoneExt], [valPerson].[PersonEmailAddress1], [valPersonDepartment].[PersonDepartmentDescription], [valPersonFacility].[PersonFacilityDescription] FROM valPersonFacility INNER JOIN (valPersonDepartment INNER JOIN ((valCompanyType INNER JOIN valCompany ON [valCompanyType].[CompanyTypeID]=[valCompany].[CompanyTypeID]) INNER JOIN valPerson ON [valCompany].[CompanyID]=[valPerson].[PersonCompanyID]) ON [valPersonDepartment].[PersonDepartmentID]=[valPerson].[PersonDepartmentID]) ON [valPersonFacility].[PersonFacilityID]=[valPerson].[PersonFacilityID] ORDER BY [valPerson].[PersonName];