When I use this:
|dbquery xxx "SELECT to_char(ORDERS.TIMEPLACED, 'hh24') || ':00:00-' || to_char(ORDERS.TIMEPLACED + 1/24, 'hh24') || ':00:00' as RANGE, DECODE(ORDERITEMS.SHIPMODE_ID,10053,'NDD-HOME',10054,'NDD-SYW',10058,'STD-HOME') as SHIPMODE, COUNT(distinct ORDERS.ORDERS_ID) as ORDER_COUNT FROM WCSRT.ORDERS, WCSRT.ORDERITEMS WHERE ORDERS.ORDERS_ID=ORDERITEMS.ORDERS_ID AND ORDERS.STATUS in ('S','C','M') AND trunc(ORDERS.timeplaced)=trunc(sysdate) AND to_char(WCSRT.ORDERS.TIMEPLACED, 'hh24')<=24 AND to_char(ORDERS.TIMEPLACED, 'hh24') NOT IN (select to_char(sysdate, 'hh24') from dual) AND ORDERITEMS.SHIPMODE_ID in (10053,10054,10058) GROUP BY to_char(ORDERS.TIMEPLACED, 'hh24') || ':00:00-' || to_char(ORDERS.TIMEPLACED + 1/24, 'hh24') || ':00:00', ORDERITEMS.SHIPMODE_ID ORDER BY RANGE"
I get valid results.
But when i try this:
|dbxquery coonnection=xxx query="SELECT to_char(ORDERS.TIMEPLACED, 'hh24') || ':00:00-' || to_char(ORDERS.TIMEPLACED + 1/24, 'hh24') || ':00:00' as RANGE, DECODE(ORDERITEMS.SHIPMODE_ID,10053,'NDD-HOME',10054,'NDD-SYW',10058,'STD-HOME') as SHIPMODE, COUNT(distinct ORDERS.ORDERS_ID) as ORDER_COUNT FROM WCSRT.ORDERS, WCSRT.ORDERITEMS WHERE ORDERS.ORDERS_ID=ORDERITEMS.ORDERS_ID AND ORDERS.STATUS in ('S','C','M') AND trunc(ORDERS.timeplaced)=trunc(sysdate) AND to_char(WCSRT.ORDERS.TIMEPLACED, 'hh24')<=24 AND to_char(ORDERS.TIMEPLACED, 'hh24') NOT IN (select to_char(sysdate, 'hh24') from dual) AND ORDERITEMS.SHIPMODE_ID in (10053,10054,10058) GROUP BY to_char(ORDERS.TIMEPLACED, 'hh24') || ':00:00-' || to_char(ORDERS.TIMEPLACED + 1/24, 'hh24') || ':00:00', ORDERITEMS.SHIPMODE_ID ORDER BY RANGE".
I get 'no results found'.
Can someone explain why DBXquery does not work as smoothly as DBQuery ? How do I convert my current DBQueries to work with DBXQuery as well?
... View more