This Query is written in DB2 with Maximo on Workorder table, but I believe its the same for almost all.
for Oracle: Use Sysdate instead of Current Timestamp
SELECT w.reportdate
,to_date(to_char(CURRENT timestamp-1,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' ) yesterday
,to_date(to_char(CURRENT timestamp,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' ) today
FROM WORKORDER W
WHERE 1=1
--FETCH FIRST 10 ROWS ONLY
AND W.reportdate BETWEEN to_date(to_char(CURRENT timestamp-1,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' ) AND to_date(to_char(CURRENT timestamp,'YYYY-MM-DD')||' 05:00:00','YYYY-MM-DD HH24:MI:SS' )
for Oracle: Use Sysdate instead of Current Timestamp
No comments:
Post a Comment