Mysql - Sort records from given date, Sort records from current day

Sort records from given date

Mysql automation- Sort Records from today

Key 1:This idea is most usefull to sort records based on ascending sequence from current day.

Key 2:Sort Records from today
 
select ,month(future_date) as nmonth from where
 if(month(future_date)=MONTH(CURDATE()),day(future_date)>DAY(CURDATE()),day(future_date)>0)
 ORDER BY
 CASE WHEN month(future_date) >= month(date_add(current_date, interval 0 month)) THEN 0 
else 1 END,
 CASE WHEN month(future_date) >= month(date_add(current_date, interval 0 month)) THEN month(future_date)
 else month(future_date)*-1 END,
 CASE WHEN day(future_date) >= day(date_add(current_date, interval 0 day)) THEN day(future_date) 
else day(future_date)*-1 END


Key 3: This step is most useful in automation records like,

* scrolling display
* Moving slides based on seasonal requirements
* Year by year updation not required.

The topic on Mysql - Sort records from given date is posted by - Namo

Hope you have enjoyed, Mysql - Sort records from given dateThanks for your time

Tech Bluff