I need to write a stored procedure to analyse appointments for the last 12 months.
I need to get each salesperson (by ID) and for each person carry out a count of the number of appointments and count them by outcome (sale, second meeting , failure etc.) and then display them with
Salesperson, Count Sale, Count 2nd Meeting, Count Failure
Any one got any code snippets for this?