Results 1 to 5 of 5
  1. #1
    jones is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    17

    Question Crosstab Query

    Hi Everyone,

    Please help me my Crosstab query problem.

    I make a manpower table and attendance table with name, date, project code and a check box, then i make a append query so that whatever put in a manpower table with corresponding check box, it append in attendance table.



    Then i make a crosstab query so that the data will arrange according to date.

    My problem is i can't find the solution of the crosstab value if the a check box has a checked = 1 and if check box is unchecked = 0 so that when i make a total in every date, i could easily know how many people are in the project.


    As you can see in the attached, i use only the average but the result is -1 and 0.

    Now, im still searching of my two problem:

    1. the -1 value
    2. how to put the sum in crosstab query.

    Advance Thanks in a million.
    Attached Files Attached Files
    Last edited by jones; 08-14-2012 at 06:40 AM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Try Count instead of Avg.
    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
    jones is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    17
    Thank you for your suggestion but i try that already and the result is not what i expected bcoz it also count the uncheck as 1,
    what i want is the check box if is checked then = 1, and if it is uncheck it should be 0.

    Thank you very much.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Instead of the Attendance field as the crosstab Value, try this calculated field: Count(IIf([Attendance]=-1,1))

    Select Expression on the Total row.

    It works with the sample data you posted.
    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.

  5. #5
    jones is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    17
    Thank you very much Sir, I will try it.

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

Similar Threads

  1. Crosstab query
    By Deutz in forum Queries
    Replies: 8
    Last Post: 01-08-2013, 03:37 PM
  2. Crosstab Query
    By BLD21 in forum Queries
    Replies: 2
    Last Post: 09-12-2011, 11:58 AM
  3. Crosstab Query Help
    By ksmith in forum Programming
    Replies: 7
    Last Post: 12-01-2010, 07:00 AM
  4. Replies: 1
    Last Post: 07-30-2010, 10:28 AM
  5. Query - Crosstab ?
    By rob4465 in forum Access
    Replies: 1
    Last Post: 01-28-2010, 08:41 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