?
Solved

Access 2003 Query

Posted on 2013-01-03
2
Medium Priority
?
343 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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 …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

764 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