Having an issue with the MSSQL select statement using the replace function
Posted on 2014-02-19
I'm trying to do a select statement in MSSQL 2012 and PHP 5.3 from a column filled with telephone numbers. Some have spaces in between, some have hyphens, some have none. I tried the following select statement:
select *, replace(dbo.MERCHANT.CONTACT_PHONE, '-', '') as CTPHONE from dbo.MERCHANT where CONTACT_PHONE = '7781234567'
But it doesn't return any rows. I've tried inside the SQL Server Management Studio as well, but no rows are returned.
I've tried googling but I can't seem to find any help there.