Results 1 to 10 of 10
  1. #1
    poppet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2014
    Posts
    16

    Basic Question


    Hi,
    I haven't used Access much and I am just trying to familiarise myself with it.

    Supposing I had a table of children and their ages. For each age they get a certain number of points (I know this makes no sense):

    age points
    1 10
    2 15
    3 22
    4 8
    5 11

    (and so on up to the age of 20)

    How do I implement the above age to points lookup table? Could that become an access table itself or should it be in a query when calculating the points per child (in a massive if statement)?
    poppet.

  2. #2
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Is it possible to explain more what you want .

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    That could be a table. Table probably better than a long expression to calculate the points.

    Implement the lookup table by building a query that joins tables on the common age fields.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    poppet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2014
    Posts
    16
    So just to be clear...
    I will have 2 access tables. The first containing the children and their ages and the second contains an age to points mapping? There will be no relation between the tables?

    Is it possible to explain what you mean by build a query that joins the tables? How does one lookup values in a table? Presumably it works like a 2 dimensional array?

  5. #5
    poppet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2014
    Posts
    16
    I worked it out.
    Thankyou for your previous suggestions.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    poppet,

    Something like this

    tblChildren

    ChildId
    ChildName
    ChildAge

    tblAgePointsLkup
    Age
    Points

    SELECT ChildName, Points
    FROM
    tblChildren Inner Join tblAgePointsLkup
    ON tblChildren.ChildAge = tblAgePointsLkup.Age;

  7. #7
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Wow
    Very nice orange,,,,,, gorgeous
    Attached Files Attached Files

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Now lets address saving age value instead of birthdate. People grow and get older. If the child record will be worked with over several years, should save birthdate and calculate the age when needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    poppet is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2014
    Posts
    16
    Hi, thanks for the replies.
    I haven't used SQL for a few years. It is coming back to me now.
    I work in the education sector and I am working on a small project for the students at the moment. The project is an insurance problem and it has 5 of these small lookup tables. Age of client vs. fee, health of client vs fee etc. It seems to me that the above implementation is a great way of implementing a small lookup table.

    (Yes, using age will cause problems in the long run).

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    My example was simply an example.

    Do NOT use Age in your table. Use DateOfBirth, then calculate Age when you need it.
    It isn't a long term issue, it is a design issue. Change it now while it's fresh in your mind. It will save you frustration later.

    Good luck with your project.

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

Similar Threads

  1. Basic Question
    By za20001 in forum Queries
    Replies: 2
    Last Post: 04-11-2011, 03:59 PM
  2. basic (sorry) question
    By wokeeffe in forum Database Design
    Replies: 1
    Last Post: 12-21-2010, 11:20 AM
  3. Basic Question
    By Dalagrath in forum Forms
    Replies: 12
    Last Post: 10-31-2010, 05:36 AM
  4. Really basic question
    By jimlaw in forum Forms
    Replies: 1
    Last Post: 07-27-2009, 07:20 AM
  5. Basic Question
    By chris11590 in forum Forms
    Replies: 0
    Last Post: 08-04-2008, 05:57 AM

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