‎2009 Jun 28 5:29 PM
Hi All,
i want to do select single and to get the data that is last updated
how can i get it?
for example:
i have entries on table :
employee last update and additional data
123 17:34:27
123 17:35:03
123 17:35:48
i want to get the row that last update ,row number 2 ,
how can i get it with select single statement?
Best Regards
Ricardo
‎2009 Jun 28 7:20 PM
Hi, Arona
Test the following Sample Code Hope will help you to solve out your problem,
SELECT SINGLE field1 field2 MAX(field3 ) as field3 " Field3 is Time Field Here
into CORRESPONDING FIELDS OF it
from TABLE_NAME
GROUP BY field1 field2.Regards,
Faisal
‎2009 Jun 28 6:55 PM
Try this:
Select *
From Table
into itab
and emp = emp_no.
Sort Itab by update_time desc.
Read Table itab index 1.
‎2009 Jun 28 7:20 PM
Hi, Arona
Test the following Sample Code Hope will help you to solve out your problem,
SELECT SINGLE field1 field2 MAX(field3 ) as field3 " Field3 is Time Field Here
into CORRESPONDING FIELDS OF it
from TABLE_NAME
GROUP BY field1 field2.Regards,
Faisal
‎2009 Jun 29 3:08 AM
Hi,
try this,
SELECT single field1
FROM <dbtable>
INTO lv_time
ORDERBY field1
DESCENDING.field1 ---> would be the time field.
if you want for the particular employee, then do a slight change in the code,
SELECT single <field1>
FROM <dbtable>
INTO lv_time
WHERE pernr = emp_no
ORDERBY field1
DESCENDING.Thanks,
Sakthi Sri.