a98dsu98sad8sua
Technical User
Hi all,
I am trying to use this SQL query to output the results of a questionnaire into a report:
SELECT Calls.CallID, Calls.CallTime, Calls.CallDate, Calls.CallDuration, Calls.CustomerName, Calls.CustomerNumber, Calls.AddedBy, Calls.FromComputer, Campaigns.CampaignName, Contracts.ContractName, Sections.SectionName, Managers.ManagerName, Staff.StaffName, Questions.Title, MonitoringTypes.MonitoringType, Responses.ResponseName
FROM (Sections INNER JOIN (Managers INNER JOIN (Contracts INNER JOIN ((Campaigns INNER JOIN (Responses INNER JOIN Questions ON Responses.ResponseTypeID = Questions.ResponseTypeID) ON Campaigns.CampaignID = Questions.CampaignID) INNER JOIN Staff ON Campaigns.CampaignID = Staff.CampaignID) ON Contracts.ContractID = Staff.ContractID) ON Managers.ManagerID = Staff.ManagerID) ON Sections.SectionID = Questions.SectionID) INNER JOIN (MonitoringTypes INNER JOIN Calls ON MonitoringTypes.MonitoringTypeID = Calls.MonitoringTypeID) ON Staff.StaffID = Calls.StaffID;
but the data it is returned is wrong! It has put for example both responses as an answer for a question, for example:
Is this a question? - Yes
Is this a question? - No
Obviously, it's only supposed to output the right one, but it seems to be printing the choices instead.
Sorry I can't explain it any more than that it is hard!
Any suggestions?
T
I am trying to use this SQL query to output the results of a questionnaire into a report:
SELECT Calls.CallID, Calls.CallTime, Calls.CallDate, Calls.CallDuration, Calls.CustomerName, Calls.CustomerNumber, Calls.AddedBy, Calls.FromComputer, Campaigns.CampaignName, Contracts.ContractName, Sections.SectionName, Managers.ManagerName, Staff.StaffName, Questions.Title, MonitoringTypes.MonitoringType, Responses.ResponseName
FROM (Sections INNER JOIN (Managers INNER JOIN (Contracts INNER JOIN ((Campaigns INNER JOIN (Responses INNER JOIN Questions ON Responses.ResponseTypeID = Questions.ResponseTypeID) ON Campaigns.CampaignID = Questions.CampaignID) INNER JOIN Staff ON Campaigns.CampaignID = Staff.CampaignID) ON Contracts.ContractID = Staff.ContractID) ON Managers.ManagerID = Staff.ManagerID) ON Sections.SectionID = Questions.SectionID) INNER JOIN (MonitoringTypes INNER JOIN Calls ON MonitoringTypes.MonitoringTypeID = Calls.MonitoringTypeID) ON Staff.StaffID = Calls.StaffID;
but the data it is returned is wrong! It has put for example both responses as an answer for a question, for example:
Is this a question? - Yes
Is this a question? - No
Obviously, it's only supposed to output the right one, but it seems to be printing the choices instead.
Sorry I can't explain it any more than that it is hard!
Any suggestions?
T