select date which is latest
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?
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.
Use order by clause on date field <descending>.
Hope it helps.