Can you please tell me what's wrong with this SQL? TIA.
accept startDate prompt "Input start date [eg. 5/Mar/2007]: "
accept endDate prompt "Input end date [eg. 18/Mar/2007]: "
stDt DATE := TO_DATE('&startDate', 'DD-MON-RR');
enDt DATE := TO_DATE('&endDate', 'DD-MON-RR');
if (stDt < enDt) then
select count(*) from TBORDER_ACTION where action_type = 'CH' and ctdb_cre_datetime > stDt and ctdb_cre_datetime < enDt;
The select statement is executed whether I enter 5-Mar-2007 as the start date and 22-Mar-2007 as the end date, or the other way around?