search specific postcodes

F

freelancer

I have a dbase that lists jobs which my department are in the process of
completing or have completed. When searching the dabse for a specific job or
range of jobs I can search via a parameter query for postcode (prefix)
location only. The problem I have is that when I want to search N1, for
example, I am given results for all postcodes beginning with N1 but which
includes N16, N15, N13 etc. How can I only get the results for the postcode
I enter?

As usual, any responses will be greatly appreciated.
 
J

Jeff Boyce

If you are using a query that has something like:

Like [Enter search criterion] & *

you will find all of your [postcodes] that start with whatever you enter.

If you want ONLY to see what you enter, you'd need to use something like:

[Enter search criterion]

You didn't provide the SQL statement for your query though, so diagnosis is
a bit difficult...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jerry Whittle

Assuming your postal codes are something like "N1 9FA" with a space, there
are a couple of different ways.

The low tech way is to just press the space bar after N1, then OK.

Another option would be to use the Left and InStr functions in combination
in a query to extract the values before the space. Then you wouldn't need a
wildcard in the parameter of the criteria.

Something like this in the Field of a query:

PostCodePrefix: Left([PostCode], Instr([PostCode], " ")-1)

In the criteria put something like:
[Enter the postcode prefix]
 
K

KARL DEWEY

It is according to how you are searching.
If in a query then remove the wildcard(s) from the criteria.
If using the Find icon then select Whole Field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top