April 09, 2007, 02:02 AM
<Shylaja>Year from Date
Hi,
i have a drop down box for year, where, the year previous to the current one should be selected by default and 5 year previous to the current one should be populated.
Please help me out in implementing this...
Shylaja.
April 09, 2007, 04:04 AM
Alan BShylaja
Are you building your own HTML form or using the layout painter or just auto prompt?
April 09, 2007, 06:03 AM
<Shylaja>Hi,
I found a way out... I wrote a query on DB2 that serves the purpose.
The query looks like this:
select emp_yr from
(select distinct emp_yr,ROW_NUMBER() OVER (ORDER BY emp_yr DESC) as rownumber from
(select distinct emp_yr FROM emptab
order by emp_yr desc) as aa ) as bb
where rownumber < 6
I need to convert this query to FOCUS code...
Please help me do this...
Shylaja.
April 09, 2007, 07:39 AM
FrankDutchCreate a master on the query as if the query is a table.
So suppose the query is called "MYYEARSDB2"
You create the acx and the mas by using the tool.
after that you will have a master MYYEARSDB2.MAS and you will be abble to use that "database" in your HTML report as the dynammic source of the drop down list.
Frank
April 09, 2007, 11:34 AM
BlueZoneHere is one more solution Shylaja :
<CODE>
-SET &YEAR0 = EDIT(&YYMD,'9999') ;
-TYPE &YEAR0
-*
-REPEAT GETYR FOR &I FROM 1 TO 6 ;
-SET &YEAR.&I = &YEAR0 - &I;
-GETYR
-*
-HTMLFORM BEGIN
<html>
<head><title> abc </title></head>
<body>
Select Year :
<select name="FRMYR">
<option value="!IBI.AMP.YEAR1;"selected>!IBI.AMP.YEAR1;</option>
<option value="!IBI.AMP.YEAR2;">!IBI.AMP.YEAR2;</option>
<option value="!IBI.AMP.YEAR3;">!IBI.AMP.YEAR3;</option>
<option value="!IBI.AMP.YEAR4;">!IBI.AMP.YEAR4;</option>
<option value="!IBI.AMP.YEAR5;">!IBI.AMP.YEAR5;</option>
</select>
</body>
</html>
</CODE>
Goooooooooooooooood day !!
Sandeep Mamidenna