Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 SQL Statement

Author  Topic 

Hooley
Starting Member

2 Posts

Posted - 2005-07-01 : 08:18:03
Hi

I have created a search that worked fine until i tried to tweak it abit. It is a search that searches different Fact Sheets and you can search by different criteria i.e Project Name, Location, Value etc...

The problem is that each Fact Sheet has about 17 keywords associated with it and thats what i tried to get it to search by. Trouble is the search does not work, it just shows all the records in the Access database.

Code Below:-


SELECT *
FROM FactQRY
WHERE project LIKE '%proj%' AND location LIKE '%loc%' AND keyword1 OR keyword2 OR keyword3 LIKE '%type%' AND client_name LIKE '%client%' AND divis LIKE '%divis6%' AND value_id MMColParam
ORDER BY project ASC

Any help would be greatly appreciated

Many Thanks
Chris

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-01 : 08:45:58
The query does not seem to be complete one
Post table structure
What are keywords 1,2 and 3?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Hooley
Starting Member

2 Posts

Posted - 2005-07-01 : 08:53:11
Keyword 1,2 and 3 are fields within the table in the database. There are 17 keyword fields that needs searching if that makes sense to you?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-07-01 : 09:02:52
Did you run your query?
you need to compare them with values
post table structures with sample sample data

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -