NearImpossible
Registered User.
- Local time
- Today, 07:43
- Joined
- Jul 12, 2019
- Messages
- 225
I am trying to add a few new reports to my DB and am running into some issues with my count query below on one of them
I am wanting to be able to run a report to show the Facility Name, total Tickets, total Closed Tickets, and then would calculate the Total Open Tickets, however it is erroring out as Incorrect Syntax near ')'
If I remove the =1 from COUNT (FacilityTickets.Resolved=1) as ClosedTickets, then the query runs, however it just gives me the same number as the Total Tickets.
Please advise what I am doing wrong.
thank you
Kevin
SQL:
SELECT FacilityNames.[Facility Name],COUNT (FacilityTickets.TicketID) as TotalTickets,COUNT (FacilityTickets.Resolved=1) as ClosedTickets
FROM FacilityTickets
JOIN FacilityNames
ON FacilityNames.FacilityID = FacilityTickets.FacilityID
GROUP BY FacilityNames.[Facility Name]
I am wanting to be able to run a report to show the Facility Name, total Tickets, total Closed Tickets, and then would calculate the Total Open Tickets, however it is erroring out as Incorrect Syntax near ')'
If I remove the =1 from COUNT (FacilityTickets.Resolved=1) as ClosedTickets, then the query runs, however it just gives me the same number as the Total Tickets.
Please advise what I am doing wrong.
thank you
Kevin