Viewing 7 posts - 1 through 7 (of 7 total)
There can be zeros in the middle of the number. I just didnt give it as an example.
Thanks.
July 28, 2003 at 5:46 am
I think DavidT got it...
LEFT JOIN DataPaqMFG ON convert(varchar(15),(replicate('0', (15 - len(DataPaqMFG.TD_PART))))) + cast(DataPaqMFG.TD_PART as varchar(15)) = convert(varchar(15),(replicate('0', (15 - len(products.PART_NUM))))) + cast(products.PART_NUM as varchar(15))
Can anyone find a reason...
July 25, 2003 at 9:28 am
quote:
No, the PATINDEX finds the beginning of 'ed' in the column--meaning, the index of the 'e'.The -1 is just to subtract...
July 25, 2003 at 9:27 am
Both fields in both tables have the same type and length. nvarchar 15
Can I add a dynamic amount of zeros? For instance... If the string is 123 can I add...
July 25, 2003 at 8:41 am
Frehan,
Good point. I will look at your solution to add zeros to the column without them!
Sam,
If ED isnt found then I am trying to do a LEFT with a -1.
...
July 25, 2003 at 8:31 am
Jeremy,
Good call! It works!
Here is the statement:
LEFT JOIN DataPaqMFG ON RTRIM(DataPaqMFG.TD_PART) = RIGHT(RTRIM(products.PART_NUM), LEN(RTRIM(DataPaqMFG.TD_PART)))
Thanks All!
July 25, 2003 at 8:02 am
The fields will have the same value...
12345 -- 12345
00123 -- 123
01234 -- 1234
01ed3 -- 1ed3
The only cases that have letters are "ed". It is roughly 200...
July 25, 2003 at 7:39 am
Viewing 7 posts - 1 through 7 (of 7 total)