Results 1 to 4 of 4
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287

    weekly query vs biweekly query - how to link up?

    Hey guys,



    I have the following 2 queries.
    Click image for larger version. 

Name:	Screen Shot 2015-12-11 at 5.14.05 PM.png 
Views:	10 
Size:	170.6 KB 
ID:	23022

    The top is based off paid wages and is biweekly. The bottom is based of time and attendance, and is weekly. The highlighted parts are for the same employee. Due to a legal issue, we have to look at everything weekly.

    What I need to do is add in the missing weeks into the top query (the odd weeks); divide the wage amounts by 2 and use half for the odd week and half for the even week. Seems relatively simple, but I'm just flat out stuck.

    I am well versed with VBA, but I have no idea how to use it to solve this problem. Any help would be greatly appreciated!

    Thanks!

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,931
    if I have understood correctly, create a table with two fields

    WKE WKO
    46....46
    46....47
    48....48
    48....49
    50....50
    50....51
    etc


    then link this to your query on WKE = Week and then the values required would be divided by 2

    Note that Year is a reserved word, using it can and will cause unexpected problems at some point - although surrounding with square brackets will often solve the problem a) why create a situation where you have to solve an unnecessary problem all the time, b) sometime square brackets don't solve the problem. Recommend you change it to something else

  3. #3
    InsuranceGuy is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2015
    Location
    Colorado
    Posts
    126
    You can also do this table-less. Something like this:

    Code:
    SELECT*FROM q_timecards_2
    	,q_wages_1
    WHERE q_timecards_2.[year] = q_wages_1.[year] AND format(INT(q_timecards_2.[week])-INT(qry_timecards_2.[week]) mod 2, "00")= q_wages_1.[week]

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,931
    good thought - though you could actually have a join on year and would also need to link on employee

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

Similar Threads

  1. Problem with a weekly query at month end
    By Gryphoune in forum Queries
    Replies: 8
    Last Post: 08-05-2014, 03:11 PM
  2. Replies: 1
    Last Post: 08-14-2013, 02:28 PM
  3. Replies: 3
    Last Post: 05-23-2013, 12:17 PM
  4. Weekly reporting comparisons in query
    By Schon731 in forum Queries
    Replies: 3
    Last Post: 10-21-2010, 06:59 PM
  5. Weekly calculation query?
    By katie_88 in forum Queries
    Replies: 1
    Last Post: 07-13-2010, 10:54 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