Wrote this SQL and just need some help how to show the last WO created date on my sql. I tried the max(evt_created "WO Date Created" and group all my selected field and it's not working.
select
obj_udfchar09 "700 Whse - Slot #",
obj_person "Assign To",
obj_category "Category",
obj_class "Class",
obj_commiss "Commission Date",
OBJ_COSTCODE "Cost Code",
R5REP.REPGETDESC('EN','PERS',obj_user,NULL,NULL) "Created By",
OBJ_CREATED "Date Created",
obj_mrc "Department",
obj_desc "Description",
obj_variable1 "Equipment Book #",
obj_code "Equipment/Asset Tag",
obj_location "Location",
obj_udfchar03 "Maintenance Division",
obj_manufact "Manufacturer",
obj_manufactmodel "Model",
obj_notused "Out of Service",
obj_variable2 "Part",
obj_production "Production",
obj_variable5 "Refrigerant Amount",
obj_variable6 "Refrigerant Type",
obj_serialno "Serial Number",
STC_PARENT "System",
STC_PARENTTYPE "Type",
EVO_TOTAL AS "Cost Summary",
evt_code "WO",
evt_created "WO Date Created",
stc_parent "System Code",
nvl(
(select sum(nvl(a.evo_total, 0))
from r5eventcost a
where a.evo_event in (select evt_code
from r5events
where evt_object = obj_code
and evt_object_org = obj_org
and evt_rstatus in ('R', 'C')
and evt_rtype in ('JOB', 'PPM'))), 0)
+
nvl(
(select sum(nvl(b.avc_total, 0))
from r5eventcost_archive b
where b.avc_event in (select aev_code
from r5events_archive
where aev_object = obj_code
and aev_object_org = obj_org
and aev_rstatus in ('R', 'C')
and aev_rtype in ('JOB', 'PPM'))), 0) "Total Cost"
from
r5objects, r5structures, r5events, r5eventcost
where
obj_code = stc_child (+) and
obj_rstatus = 'I' and
obj_code like '1%' and
EVT_CODE = EVO_EVENT (+) AND
EVT_OBJECT = OBJ_CODE (+) and
obj_code in ('1064016','1004188','1108146') and
STC_PARENTTYPE = 'S'