I have an Expiration date column on my table, I want to fetch records in order that are nearly to expire. I used 'ORDER BY DATE DESC' but it only arrange the date in descending order.
output using 'ORDER BY DATE'
Is this what you want?
order by abs(datediff(day, getdate(), [date]))