How do I create a query that reports the number of Yes, No, and Total of a given colu

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hueffmea
    New Member
    • Jun 2013
    • 2

    How do I create a query that reports the number of Yes, No, and Total of a given colu

    Context:
    I'm in a posiiton where there is a master spreadsheet. Everytime a change needs to be made we have to make the same change many times on multiple tabs and reports. I want to convert the process to Access.

    The spreadsheet contains a column which is a textual, "Yes".
    I have used the wizard to convert the spreadsheet to an Access database.

    I am stuck on a query that will allow me to replicate some of the tables on the spredsheet.

    Mainly, there is a table that calculates how many Full time employees, Contractors and total number of positions a given department has.

    Using the Design view, I've pulled up the database and opened the Agency table.
    I selected the "Department " catagory and set it to Group By ascending.

    I then tried many different things for the next three columns.

    I can get the total, but not the Yes, and nulls.

    If I use Critera, it makes it so that I can not see both the Yes and the total, and I can't seem to get a count of the Null values at all.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    I don't see what yes and nulls have to do with:
    Full time employees, Contractors and total number of positions a given department has.
    It would help to see some sample data and results because I have trouble understanding your description of the issue.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      @Rabbit: IMHO - It’s a fundamental mis-understanding of the value stored within the text field when empty. There was a discussion about this in one of the threads last year… I’ll have to see if I still have the link as it had a link to how the properties could be set in the table in design to allow for the possibility of storing a Null; however, if I remember correctly, the actual Null value in a table field in Access has to be via a VBA action.
      ----
      @hueffmea: A few quick links about how things are stored within Access
      http://office.microsof t.com/en-us/access-help/what-is-a-null-value-in-access-HA001056283.asp x (v2002) This concept carries thru to V2010
      In Access, a Null value indicates missing data in a field. A field could contain a Null value because the information is not known, or because the field doesn't apply to the record. A Null value is not the same as a value of 0 (zero) or a zero-length string ("") because those values are defined - you know what they are
      Basically, normally what is in your text field is the "" not a Null when the field is empty.

      Field properties quick reference (v2007) The only difference between V2007 and earlier may be the available field types.
      Before you get too far into the design of the database you should read thru > Database Normalization and Table Structures. Starting out with a well normalized database will save you SOOOOOO many issues in the future AND if you get into a bind, it makes it much easier for us to help. If you don’t understand this concept, there are a lot of tutorial sites out there, and if there is something specific, we can help there too. :)

      And finally you might benefit from reading thru on the following: Introduction to queries I realize it's somewhat basic; however, I've often found that a good basic resource is often more helpful in nudging the old memory than the more complex ones.
      Last edited by zmbd; Jun 24 '13, 06:29 PM. Reason: [z{fixed grammer error... should sleep a the keyboard :) }]

      Comment

      • hueffmea
        New Member
        • Jun 2013
        • 2

        #4
        Thank you, I have finsihed reading the articles and they were quite helpful. I still don't know how to do what I'm trying to do though.
        I think I can explain it better now.

        I have converted the spreadsheet to several tables in Access.
        The table I am dealing with is called AGO_OLD.
        It has a Field called Contractor.
        The field contains the word "Yes" or it is left blank.

        It also has a Field called Department.

        I want a query that tells me how many enteries are marked yes, how may are left blank, and how many there are of both yes and blank, for each department.

        Comment

        Working...