Solved

Access 2003 Query

Posted on 2013-01-03
2
337 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
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
Comment Utility
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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now