Table: ROLHAND
dos_id rol_datum note
--------+-------------+----------
1 01-01-01 111
1 01-01-03 222
1 01-01-02 333
2 01-01-11 444
2 01-01-10 555
I want to select the rol_datum and note record with the highest date order by dos_id
Output:
1 01-01-03 222
2 01-01-11 444
This output I want to place into the table MAXHAND
How can I realise this, can someone help me?
This code does not exactly do the job
SELECT Rolhand.dos_id, MAX(Rolhand.rol_datum),Rolhand,note;
FROM ;
trv_bv!rolhand;
GROUP BY Rolhand.dos_id;
INTO CURSOR maxhand
dos_id rol_datum note
--------+-------------+----------
1 01-01-01 111
1 01-01-03 222
1 01-01-02 333
2 01-01-11 444
2 01-01-10 555
I want to select the rol_datum and note record with the highest date order by dos_id
Output:
1 01-01-03 222
2 01-01-11 444
This output I want to place into the table MAXHAND
How can I realise this, can someone help me?
This code does not exactly do the job
SELECT Rolhand.dos_id, MAX(Rolhand.rol_datum),Rolhand,note;
FROM ;
trv_bv!rolhand;
GROUP BY Rolhand.dos_id;
INTO CURSOR maxhand