From: yuvalbra on 23 Dec 2009 04:57 I work with access 2003 i used the select queries for exampels select * from tbl where a=val1 or a=val2 or a=val3 i want to get the resalus with this order * select all values(val1 and val2 and val3) * select 2 value of the 3 ([val1 and val2] or [val1 and val3] or [val2 and val3] * select 1 of the value the most import is the order of the resualts (its work like Google search) B/R Yu
From: Allen Browne on 23 Dec 2009 09:07 To get the count of each result: SELECT Table1.a, Count(Table1.ID) AS HowMany FROM Table1 WHERE Table1.a IN (val1, val2, val3) GROUP BY Table1.a; -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "yuvalbra" <u57023(a)uwe> wrote in message news:a1030948cd39b(a)uwe... > I work with access 2003 > i used the select queries for exampels > select * from tbl where a=val1 or a=val2 or a=val3 > > i want to get the resalus with this order > * select all values(val1 and val2 and val3) > * select 2 value of the 3 ([val1 and val2] or [val1 and val3] or [val2 and > val3] > * select 1 of the value > > the most import is the order of the resualts (its work like Google search) > > B/R > Yu >
From: KARL DEWEY on 23 Dec 2009 09:46 Your post is confusing. Your select statement indicates 'a' is a field name but then you want multiple results form the single field. How do you expect to ever have all values(val1 and val2 and val3) from the one field? -- Build a little, test a little. "yuvalbra" wrote: > I work with access 2003 > i used the select queries for exampels > select * from tbl where a=val1 or a=val2 or a=val3 > > i want to get the resalus with this order > * select all values(val1 and val2 and val3) > * select 2 value of the 3 ([val1 and val2] or [val1 and val3] or [val2 and > val3] > * select 1 of the value > > the most import is the order of the resualts (its work like Google search) > > B/R > Yu > > . >
From: yuvalbra via AccessMonster.com on 23 Dec 2009 16:25 I mean: i have table name tbl1 with field1 at that field i have words like : field1 word1 want to go there word2 stay connected with Word1 word3 want to meet word2 and word1 no one here today the best seller is Word2 the sql for select the three words: word1 word2 word3 will get the resualts in this order word3 want to meet word2 and word1 word2 stay connected with Word1 word1 want to go there the best seller is Word2 thats all. like in google search, i want to see first the resualts of all keys , after it some of the keys ant last one of the keys KARL DEWEY wrote: >Your post is confusing. Your select statement indicates 'a' is a field name >but then you want multiple results form the single field. >How do you expect to ever have all values(val1 and val2 and val3) from the >one field? > >> I work with access 2003 >> i used the select queries for exampels >[quoted text clipped - 12 lines] >> >> . -- Message posted via http://www.accessmonster.com
From: KARL DEWEY on 23 Dec 2009 18:08
This does what you ask -- SELECT field1 FROM tbl1 ORDER BY IIF(InStr([field1], [Enter Value1]) >0, 1, 0) + IIF(InStr([field1], [Enter Value2]) >0, 1, 0) + IIF(InStr([field1], [Enter Value3]) >0, 1, 0) DESC; -- Build a little, test a little. "yuvalbra via AccessMonster.com" wrote: > I mean: > > i have table name tbl1 with field1 > at that field i have words > like : > field1 > word1 want to go there > word2 stay connected with Word1 > word3 want to meet word2 and word1 > no one here today > the best seller is Word2 > > > the sql for select the three words: word1 word2 word3 > will get the resualts in this order > word3 want to meet word2 and word1 > word2 stay connected with Word1 > word1 want to go there > the best seller is Word2 > > thats all. > like in google search, i want to see first the resualts of all keys , after > it some of the keys > ant last one of the keys > > > KARL DEWEY wrote: > >Your post is confusing. Your select statement indicates 'a' is a field name > >but then you want multiple results form the single field. > >How do you expect to ever have all values(val1 and val2 and val3) from the > >one field? > > > >> I work with access 2003 > >> i used the select queries for exampels > >[quoted text clipped - 12 lines] > >> > >> . > > -- > Message posted via http://www.accessmonster.com > > . > |