Posted on Leave a comment

Maximo Forum – Oracle DB Select Statement

select trunc(sysdate, ‘mm’) from MAXPROD.workorder where rownum < 10

select wonum, description, reportdate from maxprod.workorder where reportdate BETWEEN add_months(sysdate,-1) and sysdate
and workorderid > (select max(workorderid) – 2500 from maxprod.workorder)

SELECT *
FROM maxprod.workorder
WHERE TO_CHAR(reportdate, ‘YYYY-MM-DD’) >= TO_CHAR(sysdate, ‘YYYY’) || ‘-‘ || TO_CHAR(sysdate, ‘MM’) || ‘-01’

SELECT TO_CHAR(reportdate, ‘YYYY-MM-DD’) , TO_CHAR(sysdate, ‘YYYY’) || ‘-‘ || TO_CHAR(sysdate, ‘MM’) || ‘-01′
FROM maxprod.workorder
where rownum < 10

select add_months(sysdate,-1) from dual;

select wonum, description, reportdate from maxprod.workorder where reportdate BETWEEN TO_DATE(’12-01-2019′,’MM-DD-YYYY’) AND TO_DATE(’12-07-2019′,’MM-DD-YYYY’)

select wonum, description, reportdate from maxprod.workorder where reportdate BETWEEN TO_DATE(‘1-01-2020′,’MM-DD-YYYY’) AND TO_DATE(‘1-07-2020′,’MM-DD-YYYY’)

Source: Maximo Forum – InterPro Solutions