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

Remove Apartment Number from Address Field 1

Status
Not open for further replies.

socalvelo

Technical User
Jan 29, 2006
127
0
16
US
CR 14
SQL Server

I'm working with street addresses.

Need to remove apartment numbers if one exists. # precedes an apartment number. example: N MAIN ST #A

I need to remove # and everything afterwards. My formula removes #, but I'm not sure how to get rid of what's to its right.


if {vw_locations.street_name} like "*#*" then replace({vw_locations.street_name},"#","")
else

{vw_locations.street_name}
 
Use:

If “#” in {vw_locations.street_name} then
Trim(Split({vw_locations.street_name},”#”)[1]) else
{vw_locations.street_name}

Be sure to replace my quote marks with your own if you copy this.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top