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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access text field number comparison

Status
Not open for further replies.

nalmond

Technical User
Mar 20, 2002
21
CA
I have a query that attempts to identify differences between current and previous versions of a data set. A linked text file is compared to a static table within access using a query that is joined on a unique ID field.

The problem is that for text fields that contain numbers as text the following OR criteria does not function. Any differences between the contents of the field that are text, eg EUR_GCCA, are identified but any that are numbers , eg 1234, are not and are found missing from the query results.
Here's an example of how the expression looks:

[TPM_NodeExtract]![Contract ID]<>[Previous_TPM_NodeExtract]![Contract ID]

Is there a more suitable operator than '<>'? Or am I completely off the mark!
 
Just convert your string values to numeric with CDbl or CInt or whatever. (Or convert the numbers to strings.) e.g.
Code:
[TPM_NodeExtract]![Contract ID] <> CInt([Previous_TPM_NodeExtract]![Contract ID])

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top