Jump to content

ordering by two dates


opalepatrick
 Share

Recommended Posts

Hi, trying to order pages by modified date, date. I can do 'sort=-date_modified, sort=-date' but that will always put the modified date first regardless of actual date order. I just want to coalesce the two fields and sort. Any ideas would be appreciated.

Link to comment
Share on other sites

Thanks for that @zoeck - I didn't pick that up even with a google site search! However, that seems to be more about either/or situations. I am trying to order by date desc with date_modified if it exists otherwise use date. Might be done in mysql with ORDER BY COALESCE(date_modified, date) 

I am re-reading just to be sure

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...