From: miladhatam on 1 Mar 2010 13:17 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 !
From: Alexey Smirnov on 1 Mar 2010 15:19 On Mar 1, 7:17 pm, "miladha...(a)gmail.com" <miladha...(a)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
From: miladhatam on 1 Mar 2010 15:50 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
From: Alexey Smirnov on 1 Mar 2010 16:52 On Mar 1, 9:50 pm, "miladha...(a)gmail.com" <miladha...(a)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)
|
Pages: 1 Prev: Use Javascripts to check value in text box Next: Question regarding detecting 404 Not Found |