|
I am a new ASP.NET developer and now I am developing a web application that works as a training management system for the company. I am working now in the last task which is developing a dashboard that shows two charts that show the following:
I know how to use the ASP.NET Chart Controls and I already developed two charts different these two remaining charts. My problem now is with the SQLServer Query that I need to get the result for these two charts. My Database Design is as following: I came up with the following complicated query, but it needs more additions. I did not know how to make it applicable for showing the above requirements. To clarify the question, let us assume we have 2 types/groups of courses; mandatory and optional. Also, we have departments; A, B and C. Suppose we have the following numbers of employees who finished the mandatory courses in each department:
I want such a query that gives me the percent of employees who finished the required courses, as well as, the optional courses in each department. Therefore, I could be able to develop a chart that shows two columns (or two series) for each department with showing the percentage of training in each one of them
(comments are locked)
|
|
Hi, Since you question is ambiguous with no sample data and desired output, I am not sure whether an employee completed one course will fall into the desired criteria OR employee should complete all courses against each group type i.e. Mandatory/Optional. Anyways I hope below snippets may help you to sort out your problem against your logic DATA INSERTION SCRIPT IF ONE COURSE COMPLETED WILL BE COUNTED IF ALL THE COURSES SHOULD BE COMPLETED AGAINST RESPECTIVE GROUP TYPES i.e. Mandatory/Optional PS: Sorry, but I was unable to test it because of time constraints. Moreover, there may be some room for improvement. Once you will provide more details, our SQL GURUs to follow may help you better. Thank you very much for your help. I really appreciate it. Your explanation is clear and amazing. Many thanks :)
Nov 17 '11 at 10:27 AM
matrix388
thanks for the compliment. So can I safely assume you have accepted it as the answer?
Nov 17 '11 at 08:57 PM
Usman Butt
Of course, you can. Many thanks for your help.
Nov 18 '11 at 08:26 AM
matrix388
Dear Usman, I know that I am asking you a lot, but now I got new requirements and I am trying to modify the first query you gave it to me here but I failed. Could you please help me with it again? If yes, I will tell you about the new changes.
Dec 09 '11 at 09:57 AM
matrix388
I have absolutely no problem in doing so. But I would rather prefer a new question to be posted. This way the whole of our community would be readily available and would love to help you as always. Please, always do post table creation scripts, sample data and desired output for better support. Thanks.
Dec 11 '11 at 08:45 PM
Usman Butt
(comments are locked)
|


Please provide us with table creation scripts, sample data (in the form of insert statements) and expected output.