Gossamer Forum
Home : Products : DBMan : Installation :

sorting search results - 2 field value types

Quote Reply
sorting search results - 2 field value types
I'm using short display/long display modification, and I'd like to have my short display sort as follows...

First displaying all records with field x = "Y", and then displaying the remaining records (all of which would have field x values of "N").

Is this possible? Thanks for your insight.

Rick


Quote Reply
Re: sorting search results - 2 field value types In reply to
Since "Y" is lower in the alphabet than "N" you would just need to set "sb" to the number of the field and set "so" to descend.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: sorting search results - 2 field value types In reply to
Yes, I can see how that would work.

But I forgot to mention that I would like to alpha sort each group of records, separately, then display the alpha sorted Y group first, followed by the alpha sorted N group. In other words:

First display all records with field x="Y" ALPHABETICALLY, and then display the records with field x="N" ALPHABETICALLY

Is this possible? If it's not possible and I implemented the first solution you sugggested, would the Y group be displayed in any particular order? Then, likewise, would the N group be displayed in any particular order?

Thanks,
Rick


Quote Reply
Re: sorting search results - 2 field value types In reply to
Oh. You want a sort by two fields. I know there is a discussion about that someplace in the forum and someone got it to work. I found it. http://www.gossamer-threads.com/...m12/HTML/001080.html

One of these days, I'll have to get around to trying it out and make up a mod. I wish the person who wrote the code would have done that.

If you don't find it, or it doesn't work for you, the records will probably be in the order they appear in the database, with the "Y" group first.


JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: sorting search results - 2 field value types In reply to
Thanks.

Your response inspired me to come up with a simpler, albeit manual, solution:

Say I'm alpha sorting by last name. I'll create a new hidden field, and manually put in this field the first three letters of the last name, only for group N I'll first enter zzz (e.g. Davis would get zzzdav in this new hidden field). Then, if I sort (ascending) by this field, I should first get Group Y in alpha order, then Group N in alpha order.

It's a little clunky, but I think it'll work for me.

Thanks again,

Rick






Quote Reply
Re: sorting search results - 2 field value types In reply to
Yep. That should work for you. Smile

JPD
http://www.jpdeni.com/dbman/