• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

Access query

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

1 Solution
Helen FeddemaCommented:
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));
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
GerhardpetAuthor Commented:
Yes that is what I want. Thank you for your help
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now