Results 1 to 4 of 4
  1. #1
    david1-b is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    2

    New User: Query based on value between two fields

    Hello,

    I am a new access user using access 2010. I have two tables, an example of their structure is in the attached PDF, and in text below. I want to be able to join/ answer question between the tables like the one outlined below.

    Reference Table: A table with the most likely pet based on income and location


    Header: Country, State, Income Min, Income Max, Pet
    Record: US , NY , 1 , 5 , Cat
    Record: US , NY , 5 , 9 , Dog

    Question Table: A table with income and location
    Header: Country, State, Income
    Record: US , NY , 5

    What type of pet will the people in the question table have?
    Answer: Header: Country, State, Income, Pet
    Record: US , NY , 5 , Cat

    The logic works like this:
    Question Country = Reference Country
    Question State = Reference State
    Question Income >= Reference Income Min AND Question Income <=Reference Income Max


    Obviously I am not working with cats and dogs but this is my table structure.

    First I guess I need to know is Access the right tool to answer these questions? It seems to me like it is. Also, if anyone can provide information on query structure and what I will need to do for relations to make it happen that would be great?

    Thanks for any advice




    Table Example.pdf

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    The Question.INCOME is filtered BETWEEN the IncRng.Max and IncRng.min.

    Click image for larger version. 

Name:	ANS.png 
Views:	11 
Size:	9.7 KB 
ID:	16647

  3. #3
    david1-b is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2014
    Posts
    2
    ranman256,

    Thank you so much. I searched a ton of examples and they were not answering my questions. You went out of your way to answer it and did a great job. I know it was a simple problem but I really appreciate it.

    Thanks
    David

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    You're welcome.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. A query based on user input in form
    By drhassan in forum Queries
    Replies: 17
    Last Post: 01-20-2014, 06:00 PM
  2. Replies: 1
    Last Post: 01-04-2014, 11:04 PM
  3. Replies: 1
    Last Post: 12-24-2012, 09:36 AM
  4. Replies: 12
    Last Post: 05-07-2012, 12:41 PM
  5. Sharepoint List Query Filter based upon User Login
    By Steven.Allman in forum SharePoint
    Replies: 5
    Last Post: 03-22-2012, 11:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums