Indrit
Member
Hello, I am in need of some input, help ...... I am building a SQL query to retrieve total number of "findings and observation" from my list of some 1000+ entries and while I already got it figured out the total number of entries (aka findings and observation) by client I cannot seem to get it right the total number of entries per client per year. Here is my SQL i have written for total number of entries by client. This works I have test it!!
Also here is the real structure of my table from which I want to retrieve the year
Please know table name is called survey_dashboard and date_time is the actual column from which I want to retrieve the Year .... and for the life of me I cannot seem to figure out the SQL part of this
Any suggestion would be greatly appreciated
Indrit
Code:
SELECT u.client AS full_name, COUNT(sd.findings_observation) AS total_findings
FROM survey_dashboard sd
JOIN client u ON sd.client = u.id
WHERE sd.findings_observation IS NOT NULL
GROUP BY sd.client, u.client
ORDER BY total_findings DESC;
Also here is the real structure of my table from which I want to retrieve the year
Please know table name is called survey_dashboard and date_time is the actual column from which I want to retrieve the Year .... and for the life of me I cannot seem to figure out the SQL part of this
Any suggestion would be greatly appreciated
Indrit
Last edited: