Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Comparisons

Status
Not open for further replies.

safraser

Programmer
Apr 12, 2001
76
0
0
NZ
Hi all
Just inherited an older access project my boss did about 10 years back and hasn't been touched since.
Anyway, after upgrading it from access 97 (I Think) to access 2007 I'm now having issues with string comparisons producing unpredictable results. Two strings, that I should be equal, sometimes are not

I've checked every module to ensure Set Option Database (I believe that is the default)

I've got around the problem by trimming and upper casing both sides of the comparison in modules, however original developer frequently joined on string fields in queries. I Know I can go into the SQL view and implement the same work around, but this is beginning to have quite a large foot print.

Long story short, is there anything you guys can suggest?
 
Don't worry guys, found the issue.
Basically the field that is causing all my issue is the string concatenation of 2 numeric fields, an integer and a double, then converted back to a double and used as the PK for a table (Don't get me started on that)

So in we have an account number 1000, and a count like .001 giving 1000.001 as the pk value.

When playing around, noticed that the max dp on the table designer was not set, so the field values I was actually getting where like 1000.001035489....

So of course, later on in when I was attempting to do string compares against user entered values I couldn't get an exact match.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top