Good Day Experts!
I have quite the quandary with my SQL Query. It "feels" like there should be a solution but I am not sure how to get there. I am looking for duplicate [Pro Number]'s across [Processing Table]'s. My current query accounts for exact match [Pro Number]'s. I have just been informed that I must account for potential leading zeroes in the target and checking [Processing Table].
So, when I compare (A2.[Pro Number] = A1.[Pro Number]) how can I also say to first strip off the leading zeroes on both sides and compare? Reason I say both sides is I will not know ahead of time which side has leading zeroes.
I know this sounds a bit confusing, please ask questions so I explain better.
Here is my query:
[CUS0101].dbo.[Processing Table] A1 with (nolock)
A1.[Process Week] = '8/21/2015'
And Exists (Select 1 From [BOR0102].dbo.[Processing Table] A2 with (nolock)
Where (A2.[Pro Number] = A1.[Pro Number])
And A2.[Pro Code] = A1.[Pro Code]
And A2.[Pro Occurrence] = A1.[Pro Occurrence]
And A2.[BOL Number] = A1.[BOL Number]
And A2.[Sales Order Number] = A1.[Sales Order Number])