Results 1 to 2 of 2
  1. #1
    alexknopp is offline Novice
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    1

    Expressions and Relations Between Queries

    Ill try to keep things as simple and informative as possible.



    I am putting together a database for a child minding agency. The idea is to record Employee Time and Child Time, then from that data, produce totals of various items for invoicing and wages etc.

    Where I am now.....

    I have 3 queries to gather the information from the tables and forms used to clock staff in and out, record mileage and any expenses they have inured during the day. The forms used to record the data daily are queried into months:
    1. Total Monthly Hours [Employee Name] [Date By Month] [Total Hours]
    2. Total Monthly Millage [Employee Name] [Date By Month] [Total Mileage]
    3. Total Monthly Expenses [Employee Name] [Date By Month] [Total Expenses]


    One more query to gather the totals of each.
    4. [Employee Name] [Date By Month] [Total Hours] [Total Mileage] [Total Expenses]

    My next step now is to use the query to calculate what is owed to the employee for each Wages, Mileage and Expenses so I end up with:
    • [Employee Name] [Date By Month] [Total Hours] [Total Mileage] [Total Expenses] [Balance Due Wages] [Balance Due Mileage] [Balance Due Expenses]


    I would love for this to be as simple as writing the expressions in the builder however, some employees are paid differently and price per mile changes (info listed in a separate table [Employee Name] [Employee Hourly Rate] [Employee Price Per Mile])

    My question is how can I tell access (query builder) to get the correct information when calculating the
    [Total Hours (from query 4)] * [Employee Hourly Rate (from Separate Table)]

    Understanding the way access creates queries based on different fields from different sources is one thing but understanding how it relates them to the right field is difficult. This will really help when it comes to sorting the other half of this job out.

    Thanks All

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Given the sample info, you would join the two tables on the employee name field. I would use an ID field rather than the name, due to the possibility of people having the same name.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Queries, Look-up, and Expressions
    By Atlascycle in forum Queries
    Replies: 22
    Last Post: 02-28-2012, 06:40 AM
  2. Problem with relations
    By PoorCadaver in forum Access
    Replies: 17
    Last Post: 10-18-2011, 12:31 PM
  3. Time Expressions in queries
    By Hammer in forum Queries
    Replies: 3
    Last Post: 01-11-2011, 09:18 AM
  4. one to one relations
    By crackpot in forum Database Design
    Replies: 2
    Last Post: 08-18-2010, 09:39 AM
  5. Replies: 3
    Last Post: 08-04-2010, 09:35 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