Hi,
I am having trouble getting Access to recognize two values as being equal to one another. Here's the situation (looks long but I am just trying to be uber-thorough):
I have a large table called chem2046, which includes three fields,
PWSID (text), CHEMID (text), VALUE (double)
and I perform a group-by on PWSID and CHEMID to get an the average of VALUE for every combination of PWSID and CHEMID, resulting in a query (let's call is "AverageValueBy System") with three fields,
PWSID, CHEMID, AverageVALUE
I have another table called ChemLevels, which has the fields,
CHEMID (text), THRESHOLD (double)
I create another query (let's call it BuggyResults) which inner-joins AverageValueByS ystem to ChemLevels on CHEMID. BuggyResults has three fields,
PWSID, CHEMID, AverageVALUE, THRESHOLD, IsEqual
where IsEqual = IIf(AverageVALU E=THRESHOLD,1,0 )
When I display BuggyResults, I have the fields AverageValue and THRESHOLD side-by-side, so I can see when they are equal. In these cases, I expect IsEqual always to be 1; however, I see that it occasionally evaluates to 0. This does not make sense to me, especially that it seems to be hit-or-miss. {I don't think the problem has to do with the join. CHEMID is never Null, and I have made things super simple by only including a single unique value in that field in the chem2046 table.}
My only guess is that this has to do with datatypes, but I can't figure out why the average a double would have compatibility problems with a double.
I can't find any rhyme or reason to this, can anyone help me??
Thanks,
Mike
I am having trouble getting Access to recognize two values as being equal to one another. Here's the situation (looks long but I am just trying to be uber-thorough):
I have a large table called chem2046, which includes three fields,
PWSID (text), CHEMID (text), VALUE (double)
and I perform a group-by on PWSID and CHEMID to get an the average of VALUE for every combination of PWSID and CHEMID, resulting in a query (let's call is "AverageValueBy System") with three fields,
PWSID, CHEMID, AverageVALUE
I have another table called ChemLevels, which has the fields,
CHEMID (text), THRESHOLD (double)
I create another query (let's call it BuggyResults) which inner-joins AverageValueByS ystem to ChemLevels on CHEMID. BuggyResults has three fields,
PWSID, CHEMID, AverageVALUE, THRESHOLD, IsEqual
where IsEqual = IIf(AverageVALU E=THRESHOLD,1,0 )
When I display BuggyResults, I have the fields AverageValue and THRESHOLD side-by-side, so I can see when they are equal. In these cases, I expect IsEqual always to be 1; however, I see that it occasionally evaluates to 0. This does not make sense to me, especially that it seems to be hit-or-miss. {I don't think the problem has to do with the join. CHEMID is never Null, and I have made things super simple by only including a single unique value in that field in the chem2046 table.}
My only guess is that this has to do with datatypes, but I can't figure out why the average a double would have compatibility problems with a double.
I can't find any rhyme or reason to this, can anyone help me??
Thanks,
Mike
Comment