Results 1 to 7 of 7
  1. #1
    QueryFury is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    4

    Trouble with query calculation

    I am trying to combine a query of employees that will automatically give me a amount earned on various jobs and pay grades.

    The columns I'm working with are "start date" "end date" and "hourly wage"

    Basically the jist of what I'm trying to do is:

    Salary: (end date - start date) * (5/7) * 8 * hourly

    The 5/7ths is because everything is done in the time frame of weeks, but employees can only work 5 days in a week regardless of days.

    Any help would be greatly appreciated.

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    What happens when you use your formula as an expression in your query? Does it work? Does it kick out errorneous information? Do you have an issue?

  3. #3
    QueryFury is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    4
    Potential Salary:[end date]-[start date]*(5/7)*8*[hourly wage]

  4. #4
    QueryFury is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    4


    This is a screenshot of what I have going on so far.

  5. #5
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481
    The screenshot doesn't show the hourly rate.
    Also, maybe the enddate has to be shown as a query field before it can be used in a calculated field.

  6. #6
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    End date does not have to be shown as a query field to use it in a calculated field. But I personally would use the following Formula
    Salaryatediff("d",[start date],[end date])*(5/7)*8*hourly

    there is 1 issue with that formula however If [end date] is null. based on your original post I am presuming that the project is completed prior to payment.

  7. #7
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Just noticed everytime I put in a colon d :d I get that stupid happy face.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-15-2011, 05:24 AM
  2. Replies: 1
    Last Post: 05-30-2011, 06:03 PM
  3. Replies: 1
    Last Post: 02-16-2011, 09:08 AM
  4. Trouble with Query
    By jbarrum in forum Access
    Replies: 1
    Last Post: 01-13-2010, 04:10 PM
  5. Trouble linking a table to a query
    By wtubell in forum Queries
    Replies: 1
    Last Post: 03-26-2009, 06:34 PM

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