Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 471
  • Last Modified:

Using Data from Table in Query

I have a query in which I have criteria:  >10 and <=20
I have a table:

Code          Low          High
A                  0               10
B                 10              20

How can I pull the value from the table in column "Low" where Code=A into a query?

FYI:  I have a whole alphabet full of codes and 5 columns of variables that I need to pass to different places in a query.
0
dgran
Asked:
dgran
1 Solution
 
Rey Obrero (Capricorn1)Commented:
try using DlookUp()

dlookup("Low","Tablename","[Code]='A'")

Open in new window

0
 
mbizupCommented:
Try this - Im guessing at your low/high criteria, but you would simply add criteria for code = A like this:

SELECT Low
FROM YourTable
WHERE Code = "A" AND  (Low BETWEEN 10 AND 20) AND (High BETWEEN 10 AND 20)

Open in new window

0
 
hnasrCommented:
Code          Low          High
A                  0               10
B                 10              20

Requirement:
Look at record With Code=A and return the value under Low?
This will use DLOOKUP so the value can be used in calculation, or display in a field on a form.


Look at record With Code=A and return a record with all the values under other columns.
This uses select With Code =A and criteria so can be displayed in a Form.

In criteria Low >10 AND AND LOW <=20 ...
0
 
dgranAuthor Commented:
Thank you!  This worked perfectly.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

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