Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to validate a physical address using MSSQL

Posted on 2010-09-03
2
Medium Priority
?
287 Views
Last Modified: 2012-05-10
What would be a good way to check mailing addresses using MSSQL? The table I am working with currently has 1,448,634 entries, I would at least try to get addresses that don't start with a number... Thanks!
0
Comment
Question by:horalia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 7

Accepted Solution

by:
bouscal earned 2000 total points
ID: 33599823


WHERE NOT ISNUMERIC(LEFT(addressfield,1))

should pull any records that do not start with a digit.
0
 
LVL 7

Expert Comment

by:bouscal
ID: 33599952
EDIT:

If you want to check for PO boxes as well you could try;

WHERE ISNUMERIC(LEFT(address,1)) = 0
AND LEFT(address,3) NOT IN ('POB','P.O','P O','PO ')


I just tested this on a Northwind db and it worked well.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

There are some very powerful Dynamic Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a di…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

721 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