Silas2
asked on
VBA double quote escaping question
How do you compare two strings when one is
3"
and the other is "3"""
which is the same 3 inches but with the double quote within the string escaped.
I want to do a straight "is string equal"
3"
and the other is "3"""
which is the same 3 inches but with the double quote within the string escaped.
I want to do a straight "is string equal"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was thinking along those lines, and stripping all the quotes out, but that's a bit crude and wouldn't catch quite a few possibilities, (although I have to think quite hard to come up with any but in large(ish) volumes there might be some)
If Replace(<SomeVar1>,Chr(34) ,"") = Replace (<SomeVar2>, Chr(34),"") then
'whatever
Else
'whateverelse
Endif
'whatever
Else
'whateverelse
Endif
I was thinking along those lines, and stripping all the quotes out, but that's a bit crude and wouldn't catch quite a few possibilities, (although I have to think quite hard to come up with any but in large(ish) volumes there might be some)If you think of a possibility, let me know.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I can't tell you how many of these situations I have fixed over the years. It's almost always better to simply resolve the data problem by splitting the mushed field once. Then everything else just works better. Of course if you have no control over the table schema you're SOL.
If Val(first string) = Val(second string) Then