This is perhaps too simple, but I can’t seem to figure this one out.
I have a simple SELECT DISTINCT statement which returns two rows: CODE and DESCRIPTION
They are identical like this:
00065 Stmt to Party 2-4 pgs
00065 Stmt to Party 2-4 pgs
However, the DISTINCT in the SELECT statement never filters the duplicate one out. I tried pasting these two values in Excel 2010 and attempted to use the “Remove duplicate” function, no use; I also tried a simple formula like this: =IF(D337=D338,”X”,”Y”) and the result was always “Y”.
AutoFilter in Excel also indicated that these strings are different.
The lengths of the strings are equal, as tested with SQL Server LEN(DESCRIPTION) function. There were no invisible special characters in them either.
How do I find out what is different between these two strings? Please note that I used Excel for testing/troubleshooting purpose only.
Please help. Thank you.
Use an offline hex editor, or an online facility such as http://www.string-functions.com/string-hex.aspx and compare the bytes in the two strings. Then you should see if they are identical. (From comment above)
You could then do a manual query where you update the database by either deleting or updating the string to get the value consistent.