SELECT QUERY ( SELECT date equal or less then to post date)

Dear,

i have data table which includes date wise data, I want a SELECT query
for example :
DATE
2016-03-31
2016-04-01
2016-04-02
2016-04-05
2016-04-06

NOW if i enter date 2016-04-02 , then it should show data of 2016-04-02

but if i enter date 2016-04-03 then it should show date of 2016-04-02 because table does not has data for date 2016-04-03.

Regards,
Muhammad Khan

Try this

What logic are you after? If a date is not stored, should it automatically default to the next previous date? What if that date is two months previous?

Sponsor our Newsletter | Privacy Policy | Terms of Service