/* Description: Ermittlung aller IR's die neuer sind als das angegebene Datum
   siehe auch ..\OracleSQL\IRs_by_Date_MsSqlServer.SQL */
SELECT i.puid          AS ItemPuid,
  i.pitem_id           AS ItemName,
  ir.puid              AS IrPuid,
  ir.pitem_revision_id AS IrRev,
  paoir.plast_mod_date AS IrLastModDate,
  s.psite_id           AS IrOwningSite_TCE_pSite_ID
FROM infodba.PITEM i
LEFT JOIN infodba.PITEMREVISION ir on (i.puid = ir.ritems_tagu)
LEFT JOIN infodba.PPOM_OBJECT o on (ir.puid = o.puid)
LEFT JOIN infodba.PPOM_IMC s ON (o.rowning_siteu = s.puid)
LEFT JOIN infodba.PPOM_APPLICATION_OBJECT paoir ON (ir.puid = paoir.puid)
WHERE paoir.plast_mod_date >= TO_DATE(:para_plast_mod_date, 'DD.MM.YYYY HH:MI')
-- 24.01.2012 18:50 J.Fes Order By in JS verlegt
-- Order by
--   paoir.plast_mod_date Asc
