11-12-2007 3:25 PM
Hi ,
I am trying to pick a field from a database table based on the date...
I should select "the latest day in the past from today "...How do I write the select statement?
11-12-2007 3:30 PM
Select all records into a table and then sort the table on date <descending>. Read this table with index 1. This will give you the latest record.
OR
Use order by clause on date field <descending>.
Hope it helps.
Lokesh
11-12-2007 3:30 PM
Select all records into a table and then sort the table on date <descending>. Read this table with index 1. This will give you the latest record.
OR
Use order by clause on date field <descending>.
Hope it helps.
Lokesh
11-12-2007 3:31 PM
Hi,
You can use SELECT ... UP TO 1 ROWS statement with ORDER BY <date field> DESCENDING option.
Regards,
Ferry Lianto
11-12-2007 3:34 PM
SELECT single * FROM <dbtable> WHERE region = 'R1'
ORDER BY DATE DESCENDING.
this is possible......
but it is not good performancewsie....
so select into internal table....sort by date descending and use it.....!!!!
11-12-2007 3:37 PM
Hi ramana,
Check this..
SELECT * FROM <tab> WHERE matnr EQ 'ABCD'
ORDER BY updat DESCENDING.
ENDSELECT.
Ooooops ...I'm too late
Message was edited by:
Sudhakar G