I want to make a bar chart in Visual Studio. The data I want to display is in SQL. When I configure the data source it asks me to 'Specify a custom SQL statement or stored procedure'. I put this code into it
SELECT 'A' AS STATUS, COUNT(*) AS A FROM TABLE1
WHERE VALIDATED = 'Y'
GROUP BY 1
UNION
SELECT 'B' AS STATUS, COUNT(*) AS B FROM TABLE2
WHERE RESOLVED = 'N'
GROUP BY 1
UNION
SELECT 'C' AS STATUS, COUNT(*) AS C FROM TABLE1
GROUP BY 1
and when I test the query it doesn't work. I have also tried saving a new table in SQL and connecting to the table but that also doesn't work.
Do you know why my code isn't working or how to make my chart work?
Thanks