Sort with condition

rollo

Registered User.
Local time
Today, 15:47
Joined
Feb 22, 2002
Messages
10
I have a table which includes the following fields:
Base.....Check.....AC.....Ref....Location
A......................PA.....N628...HTV/SPO
A...........x..........PA.....N525...LMN/PCY
B...........x..........PA.....N526...PCY/LMN
F......................BM.....G304...MPE/YUR
C......................LP.....P202...SPR/SPO
D...........x..........MB.....B190...CPN/OST
E...........x..........MB.....B191...OST/LMN
I need to find a way of sorting any of the fields ascending/descending but, where records are marked with an 'x' in the Check field, the records concerned need to stay next to each other as a pair after the sort.
Is there any way that this can be done?


[This message has been edited by rollo (edited 02-22-2002).]

[This message has been edited by rollo (edited 02-22-2002).]

[This message has been edited by rollo (edited 02-22-2002).]
 
If the only value is X and Null, you may sort the query by descending. The x values would come first. Either that or I do not understand your problem.
smile.gif
 
Liv - many thanks for your response which is helpful if I need to find and alternative way of working round the problem. My apologies, it is probably my poor explanation.
Looking at the data:
Base....Check....AC....Ref....Location A................PA....N628...HTV/SPO A........x.......PA....N525...LMN/PCY
B........x.......PA....N526...PCY/LMN
F................BM....G304...MPE/YUR
C................LP....P202...SPR/SPO
D........x.......MB....B190...CPN/OST
E........x.......MB....B191...OST/LMN
The records marked x in the Check field are paired. (For example, PA....N525...LMN/PCY is paired with PA....N526....PCY/LMN) What I need is for these paired records to stay next to each other despite carrying out a sort on one of the other fields (eg sorting on Location). Any help at all would be greatly appreciated ...... !!!!
 
Without getting into the mechanics of how your sort is currently generated, I would create custom buttons and/or click events that sort your records as you do now, with the 'new' sort field added to the right edge of the Order By criteria. That should preserve your current sort with an additional level added on...if I'm reading correctly.

HTH,
David R
 
Many thanks for your help .... David R. Have now resolved the sort. Cheers.
 
Good, cause I had NO idea how you were achieving that sort in the first place.
If you'd asked me for clarification, I'd have been lost. Glad it got you pointed in the right direction.

David R - compass
 

Users who are viewing this thread

Back
Top Bottom