Solved

How to truncate a zip code from 9 digits to 5

Posted on 2010-09-09
4
982 Views
Last Modified: 2012-08-13
Hello,

I am creating a make table query in MS Access 2007

I have a field with the zip code in it.  The zip code is 5 plus 4 so..all the data looks like this

305190000
300800000

how can I truncate this data in my query... I assume something like exp: [ZIP_CD]5

so that the data looks kike this

30519
30080

Thanks

FaithDan
0
Comment
Question by:FaithDan
4 Comments
 
LVL 13

Accepted Solution

by:
Surone1 earned 500 total points
ID: 33639337
left([ZIP_CD],5)
0
 
LVL 1

Expert Comment

by:chadcku
ID: 33639346
Select substring(zip,1,5) as zipcode
0
 
LVL 1

Author Closing Comment

by:FaithDan
ID: 33639359
Thats what I needed... worked perfectly
0
 
LVL 75
ID: 33639361
substring doesn't work in Access.

mx
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question