Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,
I have sql "
C++
SELECT loc.street_1 + ', ' + ISNULL(loc.street_2, ' ') AS street
"

Now I just want to wipe of "," after first street name when second street name is Null. I tried like ISNULL(loc.street_2, '\b') but it's not working.. even replaced \b with 08(ASCII code) still didn't got what I want.. can one have any idea how to do that..

Thanks a lot...
Posted
Updated 3-Jul-11 13:25pm
v2

There's no backspaces going to work like that in SQL, you need to use the string functions inside TSQL to build the substring you're after. Using a backspace to try to delete a character wouldn't even work in C#, I don't think. It's just a bad idea.
 
Share this answer
 
OK.. thanks for that...Do I have to write my own string function for it.. or any predefined functions are there??
 
Share this answer
 
Don't push 'answer' to ask questions. This[^] is what you need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900