processing rows in a collection.
KarenHJul 10 2007 — edited May 9 2008I may just need another pair of eyes....
I am trying to prevent a row being added to a collection if the date range falls out of a 90 day window. My logic never fires. Any suggestions would be appreciated as I have spent the better part of the day on this. (ugh).
...
DECLARE
vSTART DATE;
vEND DATE;
vtrip number;
BEGIN
FOR i IN 1..APEX_APPLICATION.G_F01.COUNT
LOOP
vSTART := TO_DATE(APEX_APPLICATION.G_F02(i), 'MM/DD/YYYY');
vstart := to_date(Vstart,'DD-MON-YYYY');
vEND := TO_DATE(APEX_APPLICATION.G_F03(i), 'MM/DD/YYYY');
vend := to_Date(vend,'DD-MON-YYYY');
vtrip := to_number(APEX_APPLICATION.G_F04(i));
if vtrip is null then
IF vSTART < (SYSDATE - 90) OR vEND > (SYSDATE + 90) THEN
RETURN 'NH prohibits negative reports to be entered earlier or later than 90 days from today. You have entered a Start/End date outside of the '||sysdate-90||' through '||sysdate+90||' range. Please re-enter.';
ELSE
RETURN NULL;
END IF;
END IF;
END LOOP;
END;