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

Post code count

Status
Not open for further replies.

Hatty

Technical User
Oct 14, 2001
1
GB
Hi - I cannot for the life of me work out how to get a postcode count for a table. I only need to count the first 2 digits of the post code - ie EX (I don't need EX1, EX2, EX3 all counted individually). In other words I am trying to find out the most popular general postcode areas in my database for direct mailing purposes I know I have to pull down the postcode field twice in a query and assign one as 'Count' and one as 'Group by' but can anyone tell me the formula to put in please! Thanks
 

Select Left(PostCode,2) As PostCd2, Count(*) AS RecCnt
From table
Group By Left(PostCode,2) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top