Solved

Access 2003 Query

Posted on 2013-01-03
2
341 Views
Last Modified: 2013-01-03
I'm not entirely sure what happened because this worked fine on 12/15/2012 but now I am trying to run it and it isn't working.

On the query ZZZZTesting there are 2 difference columns and they are not listening to the <=-0.01 And >=0.01. Any suggestion on how to really eliminate those because there are a lot of them. What baffles me even more is why it even is giving the number. If you look at each of those columns they are exactly the same......... Help appreciated.
Query-Won-t-calc-correctly.zip
0
Comment
Question by:dminx13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38741749
i think your criteria is messed up with the use of "AND", "OR"

1. remove the criteria in your query and run

SELECT bpToTake.Number, Status.Status, bpToTake.PlanType, bpToTake.Amount1, IIf([bp_qryTaken]![ETaken] Is Null,0,[bp_qryTaken]![ETaken]) AS Taken, bpToTake.Amount2, IIf(bp_qryTaken!NTB Is Null,0,bp_qryTaken!NTB) AS NTBTaken, [bpToTake]![Amount1]-[bp_qryTaken]![ETaken] AS DeltaAmount1, [bpToTake]![Amount2]-[bp_qryTaken]![NTB] AS DeltaAmount2
FROM ((Staff INNER JOIN bpToTake ON Staff.ID = bpToTake.Number) INNER JOIN Status ON Staff.ID = Status.ID) LEFT JOIN bp_qryTaken ON (bpToTake.PlanType = bp_qryTaken.Type) AND (bpToTake.Number = bp_qryTaken.Number)
ORDER BY bpToTake.Number;

2. add the criteria in DeltaAmount1 and run

SELECT bpToTake.Number, Status.Status, bpToTake.PlanType, bpToTake.Amount1, IIf([bp_qryTaken]![ETaken] Is Null,0,[bp_qryTaken]![ETaken]) AS Taken, bpToTake.Amount2, IIf(bp_qryTaken!NTB Is Null,0,bp_qryTaken!NTB) AS NTBTaken, [bpToTake]![Amount1]-[bp_qryTaken]![ETaken] AS DeltaAmount1, [bpToTake]![Amount2]-[bp_qryTaken]![NTB] AS DeltaAmount2
FROM ((Staff INNER JOIN bpToTake ON Staff.ID = bpToTake.Number) INNER JOIN Status ON Staff.ID = Status.ID) LEFT JOIN bp_qryTaken ON (bpToTake.PlanType = bp_qryTaken.Type) AND (bpToTake.Number = bp_qryTaken.Number)
WHERE ((([bpToTake]![Amount1]-[bp_qryTaken]![ETaken])<=-0.01 And ([bpToTake]![Amount1]-[bp_qryTaken]![ETaken])>=0.01))
ORDER BY bpToTake.Number;


continue adding criteria one at a time and check the result
0
 

Author Closing Comment

by:dminx13
ID: 38741843
Process of Elimination. Must remember that next time. It wasn't the one that I was looking at that was causing the problem, it was the second one. I changed the .01 to be .02 and it worked fine.
Thanks!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question