kahaymon said:
Sorry-I remembered Sequal View (no proficiency in sequal)
This is the code that is there:
SELECT [Inpt Units].Unit, [Incident Investigation].[Month/year],
Count([Incident Investigation].ID) AS CountOfID
FROM [Incident Investigation] RIGHT JOIN [Inpt Units] ON [Incident
Investigation].[Unit location of incident] = [Inpt Units].Unit
WHERE ((([Incident Investigation].Type)="Fall") AND (([Incident
Investigation].Involving)="I") AND (([Incident Investigation].[Date of
incident]) Between #1/1/2007# And [enter end date]))
GROUP BY [Inpt Units].Unit, [Incident Investigation].[Month/year];
In this query I have a table of Incidents and a table of units that I
want to limit my query to. I am querying unit and month/yr (which is
one field) and want a count of incidents (falls). When a unit does
not have a fall in a month/yr, there is no result. I would like to
have unit, month/yr, and number of falls without regard to zero or
number....
If i understand correctly, you will want to change this to:
SELECT [Inpt Units].Unit, [Incident Investigation].[Month/year],
Sum(IIF([Incident Investigation].[Type]="Fall", 1, 0))
AS NumberOf Falls
FROM [Incident Investigation] RIGHT JOIN [Inpt Units] ON [Incident
Investigation].[Unit location of incident] = [Inpt Units].Unit
WHERE (([Incident Investigation].Involving)="I")
AND (([Incident Investigation].[Date of incident])
Between #1/1/2007# And [enter end date]))
GROUP BY [Inpt Units].Unit, [Incident Investigation].[Month/year];