Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server Where Operator 1

Status
Not open for further replies.

dhar2611

Programmer
Jan 4, 2006
23
0
0
AU
I got a idiotic question. in ASP I am doing a key word search using sql statement.

For example:

search for "computer".... results is fine. It gets only the records with the keyword like "%computer%"

search for "computer service"..... results comes out but not the way I want. my sql statement is like "%computer%" or like "%service%".

Its working. But I want to list the records with both keywords first and then list the other records with either keyword matching.

Any Idea....
 
I just copied your code and pasted on the MS Access query and it gives an error "Missing Operator". Does this mean it works only on the sql server and asp scripts. Thanks for all the information.

Many Thanks

Dave
 
Also another question. If I use "group by" will it be a problem.
 
Erm... this forum is for Mircosoft SQL Server, there are other forums for Access. I guess code from above can be translated to Access without much trouble. Try there...

> Also another question. If I use "group by" will it be a problem.

DISTINCT and GROUP BY without HAVING do the same. But if you need only de-duping feature then DISTINCT is better because of shorter and more manageable code.

------
"There's a man... He's bald and wears a short-sleeved shirt, and somehow he's very important to me. I think his name is Homer."
(Jack O'Neill, Stargate)
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top