Solved

Access query

Posted on 2011-09-16
3
319 Views
Last Modified: 2012-05-12
I need a query to show the records were field A is > then 10 compare to field B

I would show this record
A        B
500    512
But not this one
500    509

?
0
Comment
Question by:Gerhardpet
[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
3 Comments
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 36551048
Assuming that you want to return records where the difference between A and B is greater than 10, this will do it:

SELECT Nz([FieldB])-Nz([FieldA]) AS FieldDiff, tblTestNos.FieldA, tblTestNos.FieldB
FROM tblTestNos
WHERE (((Nz([FieldB])-Nz([FieldA]))>10));
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 36551060
What's the difference between those two records? Do you mean you want to show records where the DIFFERENCE between A and B is greater than 10? If so:

SELECT * FROM YourTable WHERE (FieldB - FieldA) > 10
0
 
LVL 1

Author Closing Comment

by:Gerhardpet
ID: 36551135
Yes that is what I want. Thank you for your help
0

Featured Post

Industry Leaders: 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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

707 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