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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching trough more than 1 column 1

Status
Not open for further replies.

007700

Programmer
Jan 24, 2005
20
NL
Hi there,

Maybe my problem is very simple, maybe not bur I can't seem to solve it.

I have created a query that will look trough a column for a value that I give in.
I do this with the statement
Like '*' & [What is the IP?] & "*"
in the criteria field. I would like the search to look further than one column and also look for the value that I provide in Column 1, 2 and 3.

My question is can that be done in the same statement ? If so how ?

Column 1 | Column 2 | Column 3
R01 Prim IP-Eth0 | R01 Prim IP-Eth0 | R01 Sec IP-Eth0
 
In the sql pane:
SELECT ...
WHERE ([Column 1] & [Column 2] & [Column 3] Like '*' & [What is the IP?] & "*") ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Oops, hit submit instead of preview ...
WHERE ([Column 1] & "," & [Column 2] & "," & [Column 3] Like '*' & [What is the IP?] & "*")

Another way:
WHERE ([Column 1] Like '*' & [What is the IP?] & "*"
OR [Column 2] Like '*' & [What is the IP?] & "*"
OR [Column 3] Like '*' & [What is the IP?] & "*")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks PH,

That did the trick for me...... The solution I was looking into was far to difficult, and this gave me the same results..

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top