Hello all -I have an issue with the sql listed below .It uses 2 temp tables.The sql works fine in PGADMIN (postgres),but when pasting this in sql editor in ireport 3.5.2 gives out Error message:No results returned for this query. The result i need to pick are from the select stmt way down at the end of this sql. select * from cust_sum; . Thanks for any help or suggestions given out. Code:create temp table tmp_location as(select ai.location as GEOAREANAME, ai.taxdistrict as UTILITYCODE, ai.customers as CUSTOMERSSERVED, sum(a.max_cust_affected) as CUSTOMERSOUT, date(a.etr) as ERD, date_part('hour',a.etr) as ERTfrom ( SELECT i.incidentid, i.incidentname AS incident_id, i.numcustaffected AS cur_cust_affected, i.numcustaffected AS max_cust_affected, date_trunc('hour'::text, e.timevalue + '00:01:00'::interval * i.durationestimate::double precision) + '01:00:00'::interval AS etr, i.starttime AS start_time, s.statuscodename AS site_safety, c.statusdesc AS crew_status, p.prioritycodename AS priority FROM om_incidents i LEFT JOIN om_incidentlocation l ON i.incidentid = l.incidentid LEFT JOIN ( SELECT om_incidenttime.incidentid, om_incidenttime.timeid, om_incidenttime.timevalue, om_incidenttime.timeflag FROM om_incidenttime WHERE om_incidenttime.timeid = 6) e ON i.incidentid = e.incidentid LEFT JOIN om_prioritycodes p ON i.medemer = p.prioritycode::text, om_safetystatus s, om_trblstatuscdes c WHERE i.safetypriority = s.statuscode AND i.verificationlevel = c.statuscde AND i.incidentstatus >= 10 AND i.incidentstatus < 70 AND (i.nopowerflag = 'NP'::text OR i.nopowerflag = 'PP'::text) AND i.servicecall = 'X'::text )as a, om_incidents i, (select distinct c.incidentid,c.taxdist,i.numcust,i.numcustaffected from om_trblcalls c,om_incidents i where c.incidentid= i.incidentid) as c LEFT JOIN ifactor_area_info ai ON 0||c.taxdist = ai.taxdistrict where i.incidentid = a.incidentid and i.incidentid =c.incidentid and ai.state ='NY' group by 0||c.taxdist , ai.location , ai.taxdistrict , ai.customers, date(a.etr), date_part('hour',a.etr ) order by ai.taxdistrict asc );create temp table cust_sum asselect GEOAREANAME , UTILITYCODE , CUSTOMERSSERVED, sum(CUSTOMERSOUT), max(erd) as erd, max(ert) as ertfrom tmp_locationgroup by GEOAREANAME , UTILITYCODE , CUSTOMERSSERVED; select * from cust_sum;