I have a field data like this 1648 Huntingdon Pike which separet by space.
I tried to use this select query to return 1648 Huntingdon
select CHARINDEX(PName, ' ' ) , PName from DoctorMaster
select CHARINDEX(PName, space(1) ) , PName from DoctorMaster
I do not know why CHARINDEX(PName, ' ') return 0.
select substring(PName, 1, CHARINDEX(PName, space(1) ) ) , PName from DoctorMaster
I use the above substring return nothing on substring(PName, 1, CHARINDEX(PName, space(1) ) ) ,
Thx.