Hi,
below is my base query in SQL and would be deriving some other results using aggregate fucntions.
select a.ref_num,(select DATEADD(s,a.open_date+19800,'1970-01-01 00:00:000')) as 'Opendate',(select DATEADD(s,a.resolve_date+19800,'1970-01-01 00:00:000')) as 'Resolveddate',a.sla_violation, b.symbol as 'SHolders',e.sym as 'Status', c.zPolicestation as 'Location',c.zDistrict as 'District',c.zdivision as 'Range',c.zone,c.ztype, d.sym as 'Priority' from
call_req a,zowner b,pri d,rootcause c,cr_stat e where a.zowner1=b.id and a.priority=d.enum and a.type like '%I%'and a.rootcause=c.id and a.status like '%RE%'and a.status=e.code
1)
select location,
SUM(casewhen priority='1'and sholders like'%niit%'then 1 else 0 end)as'Total P1callsof NIIT',
SUM(casewhen Priority='1'and sholders like'%niit%'and sla_violation=0 then 1 else 0 end)as'TotalResolvedcallsinBHRS NIIT',
from Stakeholders groupby Location---- this is for some getting total calls and resolved calls in BHRS.
please let me know how to write this query in rich client. kindly help.