December 22, 2015 at 12:15 pm
Hi,
I am trying to compare two columns but looks like its a data issue
One column as data like "Team Leader - XYZ" and second one has "Team Leader-XYZ"
Is there a way to clean either one within the query so I can do a comparison?
December 22, 2015 at 12:31 pm
sharonsql2013 (12/22/2015)
Hi,I am trying to compare two columns but looks like its a data issue
One column as data like "Team Leader - XYZ" and second one has "Team Leader-XYZ"
Is there a way to clean either one within the query so I can do a comparison?
Quick thought, you could possibly remove the spaces in both columns for the comparison, not going to be too efficient though.
😎
Check out this thread for an efficient way to clean the character values if you have more complex requirements than simply remove the spaces.
Edit: added link.
December 22, 2015 at 3:37 pm
Eirikur Eiriksson (12/22/2015)
Quick thought, you could possibly remove the spaces in both columns for the comparison, not going to be too efficient though.
... unless you add persisted computed columns to both tables that remove the whitespace.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 22, 2015 at 5:30 pm
Jeff Moden (12/22/2015)
Eirikur Eiriksson (12/22/2015)
Quick thought, you could possibly remove the spaces in both columns for the comparison, not going to be too efficient though.... unless you add persisted computed columns to both tables that remove the whitespace.
Yet again you beat me to it Jeff;-)
😎
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply