Hi
We are attempting to create a dynamic spreadsheet which will extract information from CRM / SQL.
We have very limited expierence in creating SQL queries and we would really appreciate any assistance. We had some assistance in creating an initial query which looked as follows:
SELECT equipment.name ,
equipment.new_m odelno,
equipment.new_s erialno ,
equipment.new_t ype ,
equipment.new_m ake,
equipment.new_m ast,
equipment.new_c apacity,
activitypartycu stomer.partyidn ame,
serviceappointm ent.scheduledst art,
serviceappointm ent.scheduleden d
FROM FilteredEquipme nt AS equipment
INNER JOIN FilteredActivit yParty AS activityparty
ON equipment.equip mentid = partyid
INNER JOIN FilteredService Appointment AS
serviceappointm ent
ON serviceappointm ent.activityid =
activityparty.a ctivityid
INNER JOIN FilteredActivit yParty AS activitypartycu stomer
ON serviceappointm ent.activityid =
activitypartycu stomer.activity id AND
activitypartycu stomer.particip ationtypemask = 11
WHERE (serviceappoint ment.statecode = 0)
ORDER BY equipment.name
This query gave us exactly the information we wanted however we noticed that a resource which has been scheduled more than once appears twice on the report on a second row.
We would prefer for the resource to be listed once and the additonal service activity details to appear in additional columns on the report.
For example, we would have equipment name, equipment model, equipment make, equipment serial number, customer name for service activity 1, dates for service activity 1, customer name for service activity 2 and the dates for service activity 2. All these fields would appear as columns and the full detail would not be repeated in a second row.
For example
Equipment Name Equipment SerialNo Customer Start Date End Date
E15 3232 ABC Shoes 15-01-2007 30-06-2007
E15 3232 ABC Shoes 01-08-2007 30-04-2007
AS
EquipName EquipSerialNo Cust Start Date End Date Cust Start Date End Date
E15,3232,ABC Shoes,5-01-2007,30-06-2007,ABC Shoes,1-08-2007,30-04-2007
Is this possible to achieve? Can we edit the query in some way to give us
the required information?
Really appreciate any assistance. .
Thanks alot
Mark
We are attempting to create a dynamic spreadsheet which will extract information from CRM / SQL.
We have very limited expierence in creating SQL queries and we would really appreciate any assistance. We had some assistance in creating an initial query which looked as follows:
SELECT equipment.name ,
equipment.new_m odelno,
equipment.new_s erialno ,
equipment.new_t ype ,
equipment.new_m ake,
equipment.new_m ast,
equipment.new_c apacity,
activitypartycu stomer.partyidn ame,
serviceappointm ent.scheduledst art,
serviceappointm ent.scheduleden d
FROM FilteredEquipme nt AS equipment
INNER JOIN FilteredActivit yParty AS activityparty
ON equipment.equip mentid = partyid
INNER JOIN FilteredService Appointment AS
serviceappointm ent
ON serviceappointm ent.activityid =
activityparty.a ctivityid
INNER JOIN FilteredActivit yParty AS activitypartycu stomer
ON serviceappointm ent.activityid =
activitypartycu stomer.activity id AND
activitypartycu stomer.particip ationtypemask = 11
WHERE (serviceappoint ment.statecode = 0)
ORDER BY equipment.name
This query gave us exactly the information we wanted however we noticed that a resource which has been scheduled more than once appears twice on the report on a second row.
We would prefer for the resource to be listed once and the additonal service activity details to appear in additional columns on the report.
For example, we would have equipment name, equipment model, equipment make, equipment serial number, customer name for service activity 1, dates for service activity 1, customer name for service activity 2 and the dates for service activity 2. All these fields would appear as columns and the full detail would not be repeated in a second row.
For example
Equipment Name Equipment SerialNo Customer Start Date End Date
E15 3232 ABC Shoes 15-01-2007 30-06-2007
E15 3232 ABC Shoes 01-08-2007 30-04-2007
AS
EquipName EquipSerialNo Cust Start Date End Date Cust Start Date End Date
E15,3232,ABC Shoes,5-01-2007,30-06-2007,ABC Shoes,1-08-2007,30-04-2007
Is this possible to achieve? Can we edit the query in some way to give us
the required information?
Really appreciate any assistance. .
Thanks alot
Mark
Comment