This discussion is archived
3 Replies Latest reply: Nov 24, 2012 2:10 AM by vansul RSS

drop down list item to select date

Great Awo' G' Newbie
Currently Being Moderated
I am using oracle form 6i, i want to use drop down list item to select date
I was able to manipulate my codes to get values for the three drop down list items year, month and day
but at when list change trigger on month to populate day , it populated accordingly but at point if I selected other month, it added the days of the new month selected to
the days of already selected month. And delete list_element command failed to provide solution..

Can any one help me out -- <email address removed by moderator so that you won't get spammed for all Eternity>
  • 1. Re: drop down list item to select date
    vansul Pro
    Currently Being Moderated
    select sysdate+rownum from dual connect by rownum <31 will give you the dates of the one month.
    you can take the above query in cursor and then populate the date in the date listItem
  • 2. Re: drop down list item to select date
    Great Awo' G' Newbie
    Currently Being Moderated
    What i meant is that if i selected 1976 as year and march as month the code will populate days in that month of the year but at same point try to change my month to June or other month
    the code failed to populate days with corresponding day of the new month selected alone instead it combined the day of previous month selected and new month together
    .Except i exit from the form and run it again
  • 3. Re: drop down list item to select date
    vansul Pro
    Currently Being Moderated
    1976 as year and march as month

    declare
    last_date date;
    nDays number;
    cursor days(v_last_date in date,vnDays in number) is
    select first_day(v_last_date)+rownum-1 sdate from dual
    connect by rownum<vnDays+1;

    begin
    select last_day(to_date(monthITEM||yearITEM,'MonthYYYY')) from dual;
    // the month is in the monthITEM
    // the year is in the yearITEM
    // last_day will have the last day of that month.
    //now you have to find the no. of days.
    select to_char(last_Date,'dd') into nDays from dual;

    for dates in days
    loop
    add_list_element(listname,dates.sdate,dates.sdate,1);
    end loop;

    end;

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points