Query Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I right a query that will ask me for a wild card and then display all the
results with that wildcard in them regardless of the column. For example - 4
columes. Eq #, Eq name, Part #, Equip Description. I want to be able to run
a query that will return all the rows that have (PT203 for example) in them
regardless of which column the PT203 shows up in.

Can it be done? Thanks

David
 
Yes, you will need you use the same "variable" in each column. Your
query would look like this:
Select YourValues
From YourTableName
Where [Eq #] Like "*" & [Enter Value] & "*"
OR [Eq name] Like "*" & [Enter Value] & "*"
OR [Part #] Like "*" & [Enter Value] & "*"
OR [Equip Description] Like "*" & [Enter Value] & "*"

When you run the query, you will get a box that pops up labeled Enter
Value and a place to enter your search item.

Hope that helps!
 
Where do I put this? I have the query box open and it lists a place to
"Criteria" the "or"

Thanks

Jeff L said:
Yes, you will need you use the same "variable" in each column. Your
query would look like this:
Select YourValues
From YourTableName
Where [Eq #] Like "*" & [Enter Value] & "*"
OR [Eq name] Like "*" & [Enter Value] & "*"
OR [Part #] Like "*" & [Enter Value] & "*"
OR [Equip Description] Like "*" & [Enter Value] & "*"

When you run the query, you will get a box that pops up labeled Enter
Value and a place to enter your search item.

Hope that helps!
Can I right a query that will ask me for a wild card and then display all the
results with that wildcard in them regardless of the column. For example - 4
columes. Eq #, Eq name, Part #, Equip Description. I want to be able to run
a query that will return all the rows that have (PT203 for example) in them
regardless of which column the PT203 shows up in.

Can it be done? Thanks

David
 
You can either take what I gave you and paste it into the SQL view of a
query or you would put Like "*" & [Enter Value] & "*" in the criteria
of each of your fields. To use OR you must put the criteria on
separate lines of the criteria section.

Where do I put this? I have the query box open and it lists a place to
"Criteria" the "or"

Thanks

Jeff L said:
Yes, you will need you use the same "variable" in each column. Your
query would look like this:
Select YourValues
From YourTableName
Where [Eq #] Like "*" & [Enter Value] & "*"
OR [Eq name] Like "*" & [Enter Value] & "*"
OR [Part #] Like "*" & [Enter Value] & "*"
OR [Equip Description] Like "*" & [Enter Value] & "*"

When you run the query, you will get a box that pops up labeled Enter
Value and a place to enter your search item.

Hope that helps!
Can I right a query that will ask me for a wild card and then display all the
results with that wildcard in them regardless of the column. For example - 4
columes. Eq #, Eq name, Part #, Equip Description. I want to be able to run
a query that will return all the rows that have (PT203 for example) in them
regardless of which column the PT203 shows up in.

Can it be done? Thanks

David
 
Thank you. That works great!

Jeff L said:
You can either take what I gave you and paste it into the SQL view of a
query or you would put Like "*" & [Enter Value] & "*" in the criteria
of each of your fields. To use OR you must put the criteria on
separate lines of the criteria section.

Where do I put this? I have the query box open and it lists a place to
"Criteria" the "or"

Thanks

Jeff L said:
Yes, you will need you use the same "variable" in each column. Your
query would look like this:
Select YourValues
From YourTableName
Where [Eq #] Like "*" & [Enter Value] & "*"
OR [Eq name] Like "*" & [Enter Value] & "*"
OR [Part #] Like "*" & [Enter Value] & "*"
OR [Equip Description] Like "*" & [Enter Value] & "*"

When you run the query, you will get a box that pops up labeled Enter
Value and a place to enter your search item.

Hope that helps!

DDrowe wrote:
Can I right a query that will ask me for a wild card and then display all the
results with that wildcard in them regardless of the column. For example - 4
columes. Eq #, Eq name, Part #, Equip Description. I want to be able to run
a query that will return all the rows that have (PT203 for example) in them
regardless of which column the PT203 shows up in.

Can it be done? Thanks

David
 
Back
Top