Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 special characters

Author  Topic 

tjonas
Starting Member

17 Posts

Posted - 2015-04-28 : 15:21:40
Im trying to find zip codes that have a '-' after the first five.
Like 16652-1452. When I search by '16652%' it doesn't return anything.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-04-28 : 16:04:54
Please show us the code as yourcolumn LIKE '16652%' would have returned 16652-1452. You can use the SUBSTRING function too for this.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2015-05-07 : 05:43:46
Use this

where zipcode like '[0-9][0-9][0-9][0-9][0-9][-]%'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -