help for sql select command !!!

Discussion in 'ASP .Net' started by miladhatam@gmail.com, Mar 1, 2010.

  1. 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 !
     
    , Mar 1, 2010
    #1
    1. Advertising

  2. On Mar 1, 7:17 pm, "" <>
    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
     
    Alexey Smirnov, Mar 1, 2010
    #2
    1. Advertising

  3. 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
     
    , Mar 1, 2010
    #3
  4. On Mar 1, 9:50 pm, "" <>
    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)
     
    Alexey Smirnov, Mar 1, 2010
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Biggie
    Replies:
    1
    Views:
    3,667
    Alvin Bruney [MVP]
    Feb 6, 2004
  2. Andrea

    help request for sql select

    Andrea, Oct 30, 2005, in forum: Java
    Replies:
    0
    Views:
    467
    Andrea
    Oct 30, 2005
  3. ecoolone
    Replies:
    0
    Views:
    800
    ecoolone
    Jan 3, 2008
  4. Ed Garcia
    Replies:
    4
    Views:
    206
    Guinness Mann
    Aug 7, 2003
  5. palmiere
    Replies:
    1
    Views:
    474
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page