Parameters

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

Guest

Guys,

I used the information from this article

http://office.microsoft.com/en-gb/assistance/HA011170771033.aspx

to create a form and query for looking up calls made to a number. It works
fine as it will allow the user to type the number in, click ok, and then
return a query with all calls to that number. But here's the issue:

The User wants to be able to do "Wildcards", what he means is he can put
*123456 and it will find all numbers which end in 123546 or 123456* so all
numbers that start with 123456 and then of course *123456* ones with 123546
in the middle.

Any ideas how I can do this? At the moment if you type *123456 for example
in the box and click OK it will return nothing as there are no calls made to
*123456.

Help!
 
Wolfman had uiteengezet :
Guys,

I used the information from this article

http://office.microsoft.com/en-gb/assistance/HA011170771033.aspx

to create a form and query for looking up calls made to a number. It works
fine as it will allow the user to type the number in, click ok, and then
return a query with all calls to that number. But here's the issue:

The User wants to be able to do "Wildcards", what he means is he can put
*123456 and it will find all numbers which end in 123546 or 123456* so all
numbers that start with 123456 and then of course *123456* ones with 123546
in the middle.

Any ideas how I can do this? At the moment if you type *123456 for example
in the box and click OK it will return nothing as there are no calls made to
*123456.

Help!

add LIKE to the criteria
 
You will need to change the query to use th LIKE operator instead = for the
comparison. So if your query currently looks something like ...

SELECT * FROM YourTable WHERE YourColumn = 55

It will find all of the rows in YourTable where there is a 55 in YourColumn.
You would change it to...

SELECT * FROM YourTable WHERE YourColumn LIKE '*55*'

To find all of the rows in YourTable where there is a 55 in any position of
YourColumn. Note, the LIKE operator accepts only strings for comparison.
Therefore you need to surround your comparison in either single or double
quotes.

There are other Gotcha's for this senario, so if you need additional help
please supply theSql statement you are currently using.

Ron W
 
Back
Top