Postal Code

A

Adam

I'd like to run a query that only includes the first part of a postal code.
There are post codes that run from "EH1 1AA" to "EH20 9ZZ" but I only want
entries that have "EH8" in my query.

Thank you for your help.
 
G

Gary F Shelton

Sounds like your string of data changes. With that said why not try a left
statement for the first three characters in one query. Then in a second query
search for only records that return EH8.
 
A

Adam

Sorry, I'm struggling a bit. The field is called Post Code. So I assume I
enter the following:

WHERE [Post Code] LIKE "EH8*"

If the above is what I'm supposed to enter then something is wrong because
it doesn't work.

Regards,
Adam

Roger Carlson said:
Use the LIKE operator.

WHERE [field] LIKE "EH8*"

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Adam said:
I'd like to run a query that only includes the first part of a postal
code.
There are post codes that run from "EH1 1AA" to "EH20 9ZZ" but I only want
entries that have "EH8" in my query.

Thank you for your help.
 
M

Michel Walsh

If you are in graphical design view, you bring the field Post Code in the
grid, if not already there, and, under it, in the criteria line, add

LIKE "EH8 *"


You may then look into SQL view, and you should see the WHERE clause
followed by something like

[Post Code] LIKE "EH8 *"



If you prefer, don't type the word WHERE in the GRAPHICAL view.



Vanderghast, Access MVP


Adam said:
Sorry, I'm struggling a bit. The field is called Post Code. So I assume I
enter the following:

WHERE [Post Code] LIKE "EH8*"

If the above is what I'm supposed to enter then something is wrong because
it doesn't work.

Regards,
Adam

Roger Carlson said:
Use the LIKE operator.

WHERE [field] LIKE "EH8*"

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Adam said:
I'd like to run a query that only includes the first part of a postal
code.
There are post codes that run from "EH1 1AA" to "EH20 9ZZ" but I only
want
entries that have "EH8" in my query.

Thank you for your help.
 
J

John Spencer

In the query grid
Field: Post Code
Criteria: Like "EH8*"

If that fails then try
Field: Post Code
Criteria: Like "EH8%"

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Adam said:
Sorry, I'm struggling a bit. The field is called Post Code. So I assume I
enter the following:

WHERE [Post Code] LIKE "EH8*"

If the above is what I'm supposed to enter then something is wrong because
it doesn't work.

Regards,
Adam

Roger Carlson said:
Use the LIKE operator.

WHERE [field] LIKE "EH8*"

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L


Adam said:
I'd like to run a query that only includes the first part of a postal
code.
There are post codes that run from "EH1 1AA" to "EH20 9ZZ" but I only
want
entries that have "EH8" in my query.

Thank you for your help.
 

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