Consulting

Results 1 to 5 of 5

Thread: Solved: Count include 0?

  1. #1

    Solved: Count include 0?

    how can i include 0 when i do count?

  2. #2
    Can you please elaborate what is your requirement.

    Do you mean running a loop with count as 0?

  3. #3
    Quote Originally Posted by avtarxing
    Can you please elaborate what is your requirement.

    Do you mean running a loop with count as 0?
    I have 4 tables:
    subject domain
    subject area
    conceptual entity
    and data model.

    im counting the number of data models "where subject area = "EADM_UA"
    and its grouped by subject area and subject domain. however some subject area and some subject domain do not have any EADM_UA.

    i would like it to output the subject area and subject domain even if it doesnt hv any EADM_UA

  4. #4
    VBAX Regular
    Joined
    Oct 2004
    Location
    Belgium
    Posts
    25
    Location
    Not clearly understand what you are trying to do. If you want to count everything, you don't have to use a where. If you want to includ the empty fields, use is null.

    "where subject area = "EADM_UA or subject area is null"

  5. #5
    here is my sql

    [VBA]SELECT Subject_Domain.Subject_Domain_Name, Subject_Area.Subject_Area_Name, Count(Subject_Area.Subject_Area_ID) AS CountOfSubject_Area_Name
    FROM Data_Model, Subject_Domain INNER JOIN (Subject_Area INNER JOIN Conceptual_Entity ON Subject_Area.Subject_Area_ID=Conceptual_Entity.Subject_Area_ID) ON Subject_Domain.Subject_Domain_ID=Subject_Area.Subject_Domain_ID
    WHERE (((Data_Model.Data_Model_Name)='EADM10_UA') And ((Subject_Domain.Subject_Domain_Name) In ('Financial','Enterprise Capital','Human Resources')))
    GROUP BY Subject_Domain.Subject_Domain_Name, Subject_Area.Subject_Area_Name;[/VBA]

    Some Subject_Domain.Subject_Domain_Name does not have a Subject_Area.Subject_Area_Name where its EADM10_UA. when i do a count

    it does not list the Subject_Area.Subject_Area_Name even though there is nothing there. however, i want it to print out the Subject_Area.Subject_Area_Name

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •