Sorting by boolean fields (1 Viewer)

habiler

Registered User.
Local time
Today, 16:11
Joined
Aug 10, 2014
Messages
70
Hi all of you,

That's my problem

I have 3 fields Yes/No.

A B C

To be in order it is necessary that: A , B and C = Yes.
I would want to print all differents combinations :

A = no et B et C = Yes
Then

A: Missing

Nom, prenom et adresse.
.....
.....

A = Yes, B=No and C = No
Then

B and C missing :
Nom, prenom et adresse.
......
.......

Etc.....
Thanks for all

Habiler
 

MarkK

bit cruncher
Local time
Today, 07:11
Joined
Mar 17, 2004
Messages
8,187
A boolean value is a number where True = -1 and False = 0. So sort away. If you sort ascending, -1 < 0, so True will sort first, which is what you want, I think. In a query, use an ORDER BY clause like . . .
Code:
ORDER BY A, B, C
. . . and ascending is the default.
Hope this helps,
 

Users who are viewing this thread

Top Bottom