how can i include 0 when i do count?
how can i include 0 when i do count?
Can you please elaborate what is your requirement.
Do you mean running a loop with count as 0?
I have 4 tables:Originally Posted by avtarxing
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
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"
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.