Ok, I am under the impression that the % character could represent any character or null. However in using this wildcard, It acts like it has to find at least one character in place of it. Can someone explain this for me?
Hopefully you can get the idea of how I am using this.
SQL
INNERJOINtable1on'%'+ltrim(str(table2.col))+'%'Likeltrim(rtrim(table1.col))
This should work right??
It doesn't. I have to spell it out like follows for desired results.
SQL
INNERJOINtable1on'%'+ltrim(str(table2.col))+'%'Likeltrim(rtrim(table1.col))ORltrim(str(table2.col))+'%'Likeltrim(rtrim(table1.col))OR'%'+ltrim(str(table2.col))Likeltrim(rtrim(table1.col))ORltrim(str(table2.col))Likeltrim(rtrim(table1.col))
I would really like to shorten this to something similar to the first sql code.
Thanks in Advance!