date closest to current date
Posted: Wed Mar 15, 2006 6:26 am
hi,
Im looking for tips on the best way to approach this. I have some dates in a mysql database and would like to return the date closest to the current date.
I thought maybe if I looked at the first date in the database and got the days between that date and the current date, continued through the rest of the table like that then the lowest number of days would be the date I want to return?
not sure if thats the best avenue to approach tbh, anyone see a better way?
cheers
Im looking for tips on the best way to approach this. I have some dates in a mysql database and would like to return the date closest to the current date.
I thought maybe if I looked at the first date in the database and got the days between that date and the current date, continued through the rest of the table like that then the lowest number of days would be the date I want to return?
not sure if thats the best avenue to approach tbh, anyone see a better way?
cheers