Results 1 to 7 of 7
  1. #1
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71

    count blank colums in crosstab query

    I have a crosstab query I want to count the blanks for each class name
    In other words is there a way to create a column for the blanks or do I need to fill the blanks with something to count. For example under column ABE1 the blank squares means 4 people have not been enrolled in that class. In column cog1 there are three blank squares meaning five people have not enrolled in tha t class. I need the sum of blanks for each column
    personID Total Of enrolltype ABE1 cog1 cult1
    1 4 1 1
    2 4 1
    1
    3 1


    4 2 1

    5 1
    1
    6 1



    1
    7 1


    Last edited by survivo01; 04-10-2012 at 08:42 PM. Reason: more info

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I see 5 blanks each under cog1 and cult1.

    Try:
    SELECT Sum(IIf(IsNull([abe1]),1,0)) AS BlankABE, Sum(IIf(IsNull([cog1]),1,0)) AS BlankCOG, Sum(IIf(IsNull([cult1]),1,0)) AS BlankCULT
    FROM Table1_Crosstab;
    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
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    I don't know how to do what you suggest.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Build a query with query designer using the crosstab as the data source and create fields with the expressions or copy/paste the sql I suggest into the SQL View editor of the query designer. Use your crosstab query name in place of Table1_Crosstab.
    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
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    Sum(IIf(IsNull([Adult Basic Education AM]),1,0)) AS BlankAdult Basic Education AM
    Here is what I entered and I get message you have entered and operand without an operator

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If spaces, special characters, or punctuation (underscore is exception) are used in names or reserved words as names, must enclose in []:
    AS [BlankAdult Basic Education AM]
    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.

  7. #7
    survivo01 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    71
    I must be not very bright.
    Sum(IIf(IsNull([Adult Basic Education AM]),1,0)) AS [BlankAdult Basic Education AM]
    Still same message and highlights the word AS

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

Similar Threads

  1. Rows & Colums in Reports
    By smarty84handsome in forum Reports
    Replies: 3
    Last Post: 02-05-2012, 12:35 AM
  2. Replies: 1
    Last Post: 01-24-2011, 03:03 PM
  3. Getting a combobox to offer colums
    By Mafukufuku in forum Queries
    Replies: 0
    Last Post: 02-24-2010, 02:43 AM
  4. Replies: 1
    Last Post: 09-05-2008, 12:07 PM
  5. Inserting data in new colums
    By wasim_sono in forum Queries
    Replies: 2
    Last Post: 02-28-2006, 01:11 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