Sort with Nulls last

Sort with Nulls last

knoebiknoebi Posts: 3Questions: 0Answers: 0
edited October 2009 in General
Hello,

is there a solution like Oracle "Order by column nulls last". My table is build bei an sql-Statement of an oracle-db. I try to sort by date-column, but in my case there are fields with no date. The date will be set bei an other application later.

My destination is: Sort by date asc and put all rows with no date at the end of the table.

Thanks.

Replies

  • allanallan Posts: 61,692Questions: 1Answers: 10,101 Site admin
    Hi knoebi,

    The internal date sorting that DataTables has doesn't cope with this as each cell in the column needs to match the date formatting in order to enable date sorting - therefore a blank string doesn't work. However (!) you can do this using a custom sorting plug-in: http://datatables.net/development/sorting . There are a number of sorting plug-ins already available: http://datatables.net/plug-ins/sorting - and while I don't think an of them exactly match what you are looking for, they could readily be modified to meet your needs!

    Regards,
    Allan
This discussion has been closed.