Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   help for sql select command !!! (http://www.velocityreviews.com/forums/t716405-help-for-sql-select-command.html)

miladhatam@gmail.com 03-01-2010 06:17 PM

help for sql select command !!!
 
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 !

Alexey Smirnov 03-01-2010 08:19 PM

Re: help for sql select command !!!
 
On Mar 1, 7:17*pm, "miladha...@gmail.com" <miladha...@gmail.com>
wrote:
> 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

miladhatam@gmail.com 03-01-2010 08:50 PM

Re: help for sql select command !!!
 
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

Alexey Smirnov 03-01-2010 09:52 PM

Re: help for sql select command !!!
 
On Mar 1, 9:50*pm, "miladha...@gmail.com" <miladha...@gmail.com>
wrote:
> 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)


All times are GMT. The time now is 06:57 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57