January 22, 200223 yr I wish to compare a field called "account" in one DB with an identical field called "account" in another DB (they are both text fields) and return "1" if the two fields match. I have used the Exact function to define a compare field. Mostly this works fine, but then for some unknown reason sometimes (1 in 20) the compare field gives me a zero even though on checking the second DB, there is a perfect match down to the last space. The account fields contain numbers but is set up as a text field. I'm going nuts. Can anyone shed some light or suggest a simpler way to do this? Thanks
January 22, 200223 yr You probably already considered this, but the Exact function is case-sensitive. If not that, could it be comparing apostrophes to single quotes? Different size underlines? Different dashes? Perhaps switching your fields to a font that shows ASCII symbol numbers might bring the culprit to light. If content is all that matters, could you do an If (field = related::field, 1, 0) calc for a less stringent comparison?
January 22, 200223 yr Exact really is exact. I tend to "soften" it a bit by making it case-insensitive... Exact( Lower(field1), Lower(field2) ) You can also Trim() the fields so it ignors (or never sees) leading and trailing spaces as well.
January 22, 200223 yr Author Thanks Gentlemen. The function still has me puzzled. Even when I cut and paste the exact field into both DBs it doesn't give me a match. I may have to rethink me approach to this one.
January 23, 200223 yr Indeed. Exact compares two text strings, the "original" and the "comparison" and they must be exactly alike, exactly alike, for the result to be true. Old Advance Man
January 25, 200223 yr Author Thanks - it seems to have solved itself. I had reason to destroy the relationship between the 2 bases and when I reset them the fields I related to each other were the same ones I wanted to compare and it worked perfectly. Regards
Create an account or sign in to comment