Hello!
I have got:
SELECT char(week_iso(current date)) FROM sysibm.sysdummy1
+------------+
| 00001 |
+------------+
| 45 |
+------------+
This is number of the week now,
And I have got table PROGN:
Select * from PROGN where id= 10714
+----------+----------+----------+----------+----------+----------+
| PRO144 | PRO145 | PRO146 | PRO147 | PRO148 | PRO149 |
+----------+----------+----------+----------+----------+----------+
| 50 | 55 | 56 | 36 | 33 | 33 |
+----------+----------+----------+----------+----------+----------+
where in name PRO1xx -xx are number of the week
And now I must do something like this:
select ID, PRO1[number of the week] from PROGN where id=
10714)
or maybe better look:
select ID, PRO1xx from PROGN where id= 10714),
where xx=SELECT char(week_iso(current date)) FROM
sysibm.sysdummy1
I try this, but no results....
select ID, 'PRO1'||(SELECT char(week_iso(current date)) FROM
sysibm.sysdummy1)
from PROGN where id= 10714)
Thanks for help.