help for sql select command !!!

M

miladhatam

Hi Everyone!
Imagine we have 3 checkBoxes in a search page and 3 boolean fields in
DB table and every checkbox is for one of these fields . In search
page users check every 3 checkBoxes and what i want is that first it
shows the records that every their 3 fields are checked then 2 and
then 1(DESC).
BTW my DB is MS Access.
Please help me !
 
G

Guest

Hi Everyone!
Imagine we have 3 checkBoxes in a search page and 3 boolean fields in
DB table and every checkbox is for one of these fields . In search
page users check every 3 checkBoxes and what i want is that first it
shows the records that every their 3 fields are checked then 2 and
then 1(DESC).
BTW my DB is MS Access.
Please help me !

ORDER BY field1, field2, field3
gives you that result. however it is not clear what does "then 2"
mean, because it could be first two, or first and third, or second and
third option
 
M

miladhatam

Thanks Alexy !

I meant after that it shows the records that have 2 checked fields and
then shows the records that have 1 checked field .
You got it . I'll try it
 
G

Guest

Thanks Alexy !

I meant after that it shows the records that have 2 checked fields and
then shows the records that have 1 checked field .
You got it . I'll try it

In my example if you have

X _ X
X X X
X _ _
X X _
_ _ X

you will get the result set ordered like this

X X X (3)
X X _ (2)
X _ X (2)
X _ _ (1)
_ _ X (1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top