Can standard ORDER BY be configured to list NULL items at the end

6 posts by 2 authors in: Forums > CMS Builder
Last Post: September 26, 2016   (RSS)

By JeffC - September 22, 2016

Hi

My items are listed in the database using 'dragSortOrder, companyName'

Any items that do not have a companyName are at the beginning of the list. Can I alter the ORDER BY clause so that entries without a company name appear at the end?

Thanks

Jeff

By Damon - September 22, 2016

Hi Jeff,

Try this query in Order By clause:

dragSortOrder, companyName = "", companyName

Let me know if this works for you.

Thanks!

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By JeffC - September 23, 2016

Hi Damon

Just to be certain that I have put this in the correct place: this should go in the Order By field, under the Sorting Tab in the Section Editor, is that right?

Thanks for your idea, but unfortunately it didn't work.

Jeff

By Damon - September 23, 2016

Just to be certain that I have put this in the correct place: this should go in the Order By field, under the Sorting Tab in the Section Editor, is that right?

Thanks for your idea, but unfortunately it didn't work.

Yes, the query goes in the Order By field under the Sorting tab.

It worked for me. Not sure what the issue may be. 

Did you get an error message?

Did the sorting change at all?

Cheers,
Damon Edis - interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By JeffC - September 23, 2016 - edited: September 23, 2016

Hi Damon. No error, but no change. Were you using it in combination with dragsortorder? I was, so maybe that was the issue? I'll try again on Monday. Not sure how to remove dragSortOrder without receiving an error - but that's another issue!

Jeff