It is often necessary to report the name of a drawing that contains equipment in an equipment location report. The following example query returns the names of all equipment and the drawings they are contained in. This query can be used in a SQL report.
select
j4.Itemname 'Equipment',j3.Itemname 'Drawing' from
XDrawingMAP X1
join XSheetHasViews x2 on X1.oidorigin = x2.oidorigin
join JDDwgSheet j2 on j2.oid = x2.oiddestination
join JNamedItem j3 on j3.oid = j2.oid
join JNamedItem j4 on j4.oid = X1.oiddestination
where j4.OID in (select oid from JSmartEquipment)
order by Equipment, Drawing