Gossamer Forum
Home : Products : DBMan : Customization :

Sort blank fields to end...

Quote Reply
Sort blank fields to end...
OK, I have a database at: http://www.scionlife.com/...1&ID=*&sb=17

My problem is that when I sort by an optional field the entries that contain nothing in that field rise to the top. I want to change that so that the entries that actually have something in that field are at the top.

I know this has something to do with the sort routine in db.cgi and probably either looking for the length of the field relative to zero or something... but I have been working on this for two days straight and my brain hurts. Any ideas?

Darren
| www.meltedmonitor.com |
Quote Reply
Re: [MeltedMonitor] Sort blank fields to end... In reply to
bump
| www.meltedmonitor.com |
Quote Reply
Re: [MeltedMonitor] Sort blank fields to end... In reply to
Sounds like it has something to do with the sort order... "so=ascending" or something.
Quote Reply
Re: [Watts] Sort blank fields to end... In reply to
Nah, the sort order is correct... here is an example:

Five items sorted numerically, including two empty entries:
1.
2.
3.06574065
4.54354355
5.94324655

I have temporarily fixed the problem by reformating all empty entries to contain the word "empty" instead of just being blank. This sorts them to the bottom. I guess this is an acceptable workaround... thanks fo your suggestion, though.

Darren
| www.meltedmonitor.com |
Quote Reply
Re: [MeltedMonitor] Sort blank fields to end... In reply to
Hmm... try changing the field type from "numer" (numeric) to "alpha" (or maybe the other way around) - probably won't work, but it's worth a try. It's seeing an empty field as zero.

Good work around though.