Query on 2 tables with like data

DJM1216

Board Regular
Joined
Apr 15, 2002
Messages
102
Hi there, here is my scenario.

I have 2 tables, one which is a customer address list, the other is a list of specific zip codes I need a customer count for.

The problem is the customer list has zip formatted in zip+4 (for example XXXXXXXXX) while the zip code list only contains 5 digit zips (XXXXX).

Is there a way to set up this query to disregard the last four digits of the zip? Or is there a way in Access to parse a column?

Also, how do I run a count query?

Thanks in advance for your assistance.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi there, try this :

LEFT([ZIPCODE],5)

NB : this assumes you have called your variable "ZIPCODE" and the variable name in the customer address list table is different to the variable name for the zip code in the zip codes table (otherwise this won't work).

Hope this helps, Andrew :)


Is there a way to set up this query to disregard the last four digits of the zip?
 
Upvote 0
Create a new field in the customer list call it say ShortZip.

Then create an update query to populate this field using Andrew's suggestion. Left([Zipcode],5).

You can now create a query linking the customer list and the specific zip codes using this new field.
 
Upvote 0

Forum statistics

Threads
1,221,813
Messages
6,162,126
Members
451,743
Latest member
matt3388

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top