Solved

Access query

Posted on 2011-09-16
3
315 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 84

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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

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.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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