Discuss Joins using trimmed columns in the MS SQL Development forum on Dev Shed. Joins using trimmed columns MS SQL Development forum discussing administration, MS SQL queries, and other MS SQL-related topics. SQL Server is Microsoft's enterprise database engine.
Time spent in forums: 1 Day 50 m 24 sec
Reputation Power: 11
Joins using trimmed columns
Hello Everyone -
I have several different tables that I am looking to join based on what we can call LDate and PolicyNum columns. The issue is that some of our legacy ETL has been inserting PolicyNum with a blank character at the end in one of our tables where the other table I want to join it with does not have the blank character.
I am really bad at SQL so what I would usually do is just do a RTrim(PolicyNum) into a temp table and then use that as a reference but really don't want to do that. Can anyone offer some sample code to work with the following example query requirements:
TableA (the one with the extra character at the end of the policy number)