I have to to create a query that produces a count by the first letter(s) of the postcode where the count is greater than 100. (In Bitish postcodes)
For e.g.
First Letter(s) of Post code Count
B 300
CM 260
CR 237
CV 288
NOT
B1 200
B2 150
CM 260
Any help would be appreciated.
Thanks
Addy
10 3111
I don't know British postal codes so you'll have to help me out here.
First thing you need to do is seperate the letters from the numbers and then do the count. How many letters can there be in the postal code?
And are there always spaces between letters and numbers?
Well I finally decided to just look it up so... -
SELECT iif(IsNumeric(Mid(Postcode,2,1)), Left(Postcode,1), Left(Postcode,2)) AS Area, Count(Postcode) AS CountOfArea
-
FROM tbl_Postcodes
-
GROUP BY iif(IsNumeric(Mid(Postcode,2,1)), Left(Postcode,1), Left(Postcode,2));
-
Hi
Thanks for the reply. Post code could be of the form:
B19 2TT
B17 3SW
SW19 0XL
KT19 0NR
BW1 15TS
I need to count the occurance of first letter or letters before the space(There is always a separation in the UK postcodes). For example if I have fifty thousand postcodes, I need to count how many were of the form B's, BW's or SW's, KT's or K's. I need to try this in access table where there is only one field called Post Code. I am not very good at queries in Access, that is why I have posted it here.
Thanks
Addy
Hi
Thanks for the reply. Post code could be of the form:
B19 2TT
B17 3SW
SW19 0XL
KT19 0NR
BW1 15TS
I need to count the occurance of first letter or letters before the space(There is always a separation in the UK postcodes). For example if I have fifty thousand postcodes, I need to count how many were of the form B's, BW's or SW's, KT's or K's. I need to try this in access table where there is only one field called Post Code. I am not very good at queries in Access, that is why I have posted it here.
Thanks
Addy
You can also have BB4 4BB (ie just two numbers in between.
Pretty much L{L}#{#}_#LL
Hi
Thanks for the reply. Post code could be of the form:
B19 2TT
B17 3SW
SW19 0XL
KT19 0NR
BW1 15TS
I need to count the occurance of first letter or letters before the space(There is always a separation in the UK postcodes). For example if I have fifty thousand postcodes, I need to count how many were of the form B's, BW's or SW's, KT's or K's. I need to try this in access table where there is only one field called Post Code. I am not very good at queries in Access, that is why I have posted it here.
Thanks
Addy
... And that's exactly what I've given you in post #4, is there a problem with it?
Thanks for the query, it is understandable however I do not know how to implement it as I am quite new to Access. Please help me understand in what form should I apply this query
Thanks again
I have tried select query and when I ran it I got the following result for BW
Area Count
BW 9
which is not correct. I have 2 postcodes starting with BW in my table. Please check the query.
Thanks
Addy
I am sorry but the Postcode field name I selected initially was incorrect(Post_Code) and I have changed it to Postcode. It is working now.
Thanks a lot
Addy
Not a problem, good luck.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: AJ |
last post by:
Hi All
Just a quickie. A form element for a search will contain either a town or a
post code. Is there any way we can check the input to see if the element
contains a number (in which case it...
|
by: Lapchien |
last post by:
I have a field for a postcode. I'd like another field to auto contain an
'area' number, based on the first part (only) of the postcode. For example,
if a postcode LS4 4DJ was entered, another...
|
by: dd_bdlm |
last post by:
I am trying to isolate the identifying area codes from postcodes and
want to extract the first one or two letters from each postcode. I have
created a query that uses:
SmallPostCode:...
|
by: Julian |
last post by:
Hi,
I am a very beginner in databases. I created a database table in Access 2003
and OOo 2.03 that includes name, address, postcode, phone numbers etc of our
customers. I would like to sort...
|
by: mark |
last post by:
I have a table of UK companies whose records I want to filter using a
map of postcode regions.
For the benfit of people outside the UK, our postcodes are a pain to
work with because they are not...
|
by: xhe |
last post by:
I am now developing a website which needs Canadian PostCode Database.
I can certainly buy one, but that will cost my hundered of $$, and my
website is only for education purpose, it won't make...
|
by: billynastie2007 |
last post by:
Hi i am writing a balloon race site and i am having problems with some functions to calculate the distance the balloon travels firstly i am reading my info from the database using the fetch assoc...
|
by: Pinna |
last post by:
Hiya, I am trying to select based on a range on postcode on a table. The field POSTCODE is a varchar2(8).
The problem is when refinng on 'where postcode between 'PE1' and 'PE29'', because this is...
|
by: dominicowen |
last post by:
Hi,
I have a customer database in Access 2003 with customers postcodes.
What I want to do is type in a postcode on access and it will link the postcode on to googlemaps without having to type...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |