Solved

How do I reference another table's field value in MS Access query?

Posted on 2016-08-24
5
40 Views
Last Modified: 2016-08-25
Dear Experts!

Please see attached file. What is the proper syntax for referencing a field from a different table in my query? The query works great when I type a date in manually but when I reference a field it does not.

Thanks!
screenshots.pdf
0
Comment
Question by:shogun5
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41768716
You can only reference tables that are included in the query.  You can drag this table onto the QBE and draw a join line between the two dates.  Remove the criteria because the join will serve that purpose.  Then put the query into SQL view and change this join's relational operator from "=" to ">=".  Once you change to a non-equi join, you won't be able to return to QBE view since the editor can only display equi-joins graphically.

Another way to enter criteria is to use a form to run the query/report/form.  The query would reference the form.

Where SomeField = Forms!someform!somefield
0
 

Author Closing Comment

by:shogun5
ID: 41769480
Pat,

Worked like a charm! Thanks!
0
 
LVL 35

Expert Comment

by:PatHartman
ID: 41769482
Great.  Which method did you use?
0
 

Author Comment

by:shogun5
ID: 41770139
I just changed the sign in SQL it was easy enough.
0
 
LVL 35

Expert Comment

by:PatHartman
ID: 41770599
Thanks.  It is always good to clarify which solution worked for you when more than one is offered.  That helps people who find the thread later.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

777 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