Hi
I am trying to create a custom report of Microsoft CRM data in Visual Studio.
I am extracting data from two different tables, an incident table and a service appointment / activity table. We trying to create a service report which we can send to our customers at the end of each month.
My query is:
SELECT CRMAF_FilteredI ncident .createdon
CRMAF_FilteredI ncident .customeridname
CRMAF_FilteredI ncident .new_typeofsupp ortname
CRMAF_FilteredI ncident .owneridname
CRMAF_FilteredI ncident.respons ibleidcontactna me
CRMAF_FilteredI ncident .incidentid
FilteredService Appointment .new_avsoftware name,
FilteredService Appointment .new_updatesrec eivedname,
FilteredService Appointment .new_backuptest name,
FilteredService Appointment .new_cablinginf rastructurename ,
FilteredService Appointment .new_backuptest name,
FilteredService Appointment.new _serviceidname
FROM FilteredInciden t AS CRMAF_FilteredI ncident
INNER JOIN FilteredService Appointment as serviceappointm ent ON
serviceappointm ent.regardingob jectid = CRMAF_FilteredI ncident.inciden tid
The tables are correctly joined except I am having two issues.
1. Data is now repeated for each case that has more than one service activity.
2. The second table which shows service activity information is repeated for
each service activity even the service activities do not contain the required data. I only want to display service activities where the serviceidname equals Maintenance. I need to show all cases though and not only the cases which relate to service activities which are associated with the service Maintenance.
Does anyone have an idea as to how I could streamline the presentation of my report? I would really appreciate any suggestions.
I assume that I may need to include a WHERE statement.
Thanks
Mark
I am trying to create a custom report of Microsoft CRM data in Visual Studio.
I am extracting data from two different tables, an incident table and a service appointment / activity table. We trying to create a service report which we can send to our customers at the end of each month.
My query is:
SELECT CRMAF_FilteredI ncident .createdon
CRMAF_FilteredI ncident .customeridname
CRMAF_FilteredI ncident .new_typeofsupp ortname
CRMAF_FilteredI ncident .owneridname
CRMAF_FilteredI ncident.respons ibleidcontactna me
CRMAF_FilteredI ncident .incidentid
FilteredService Appointment .new_avsoftware name,
FilteredService Appointment .new_updatesrec eivedname,
FilteredService Appointment .new_backuptest name,
FilteredService Appointment .new_cablinginf rastructurename ,
FilteredService Appointment .new_backuptest name,
FilteredService Appointment.new _serviceidname
FROM FilteredInciden t AS CRMAF_FilteredI ncident
INNER JOIN FilteredService Appointment as serviceappointm ent ON
serviceappointm ent.regardingob jectid = CRMAF_FilteredI ncident.inciden tid
The tables are correctly joined except I am having two issues.
1. Data is now repeated for each case that has more than one service activity.
2. The second table which shows service activity information is repeated for
each service activity even the service activities do not contain the required data. I only want to display service activities where the serviceidname equals Maintenance. I need to show all cases though and not only the cases which relate to service activities which are associated with the service Maintenance.
Does anyone have an idea as to how I could streamline the presentation of my report? I would really appreciate any suggestions.
I assume that I may need to include a WHERE statement.
Thanks
Mark
Comment