Results 1 to 4 of 4
  1. #1
    ccordner is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    65

    Total Query


    Hi.

    I'm trying to write a query to count the number of "Rest Days" worked in the current period. I have built the query below (actually, it was much more complicated until I realised it wasn't working) and it will count the rest days for each cost centre, but it includes all the rest days worked, not just the ones for the current period.

    Is it something I've missed, or do I have to do it as two separate queries?

    Thanks
    Chris

    Click image for larger version. 

Name:	AccessForumPost.JPG 
Views:	16 
Size:	68.7 KB 
ID:	6497

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    What is current period - this week, month, quarter? Need filter criteria.

    BTW, not a good idea to use special characters and punctuation (underscore is exception) in names. Better would be: TargetRestDays or Target_RestDays
    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.

  3. #3
    ccordner is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    65
    Thanks

    Periods are stored in a table, tblPeriods, with the Start and End date for each. Normally they are four weeks except at the beginning and end of the year (sometimes) so the last one finishes at the end of March.

    qryCurrentPeriod retrieves the period where today is greater than (or equal to) the start date and less than (or equal to) the end date. I have a similar query, qryLastPeriod too.

    I'm slowly changing some of the field names, but things in other programs depend on them, so I'm being a bit careful not to 'break' anything!

    Thanks
    Chris

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Did you try adding criteria to the query design?
    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.

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

Similar Threads

  1. Total Query
    By joannakf in forum Queries
    Replies: 1
    Last Post: 12-22-2011, 05:35 PM
  2. Total Query
    By melonwand in forum Queries
    Replies: 24
    Last Post: 10-17-2011, 01:30 PM
  3. 'Total rows' in query
    By sk88 in forum Access
    Replies: 4
    Last Post: 08-29-2011, 09:31 AM
  4. Help with Query Total
    By mohara in forum Queries
    Replies: 4
    Last Post: 08-20-2010, 02:35 PM
  5. Total a Query
    By Bridgid in forum Queries
    Replies: 0
    Last Post: 09-05-2009, 02:51 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