Query to return Pivoted result in SQL Server

indradeo
 
on Jun 21, 2022 06:11 AM
291 Views

Dear Sir,

Need your help here,

I want to generate report as mention format.

I have no code for this type of reports.

  Meja Thermal Power Plant Safety Information System Tuesday 21/6/2022 BACK
  Emp. Id:- 007221 Name:- D P Chakraborty Department:- IT Month:- 06/2022  
MONTH WISE SUMMARY
MONTH NUMBER OF PEP-TALKS CONDUCTED NEAR MISS REPORTED SAFETY DEVIATION OBSERVED & REPORTED TOOL & TACKLES CHECKING CONDUCTED
April-2022        
May-2022        
June-2022 4 3 2 2
July-2022        
Aug-2022        
Sept.-2022        
Oct-2022        
Nov.-2022        
Dec.-2022        
Jan-2023        
Feb.-2023        
Mar.-2023        
Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Jun 21, 2022 08:20 AM

You need to use Pivot function to calculate the total.

Refer below link.

Calculate Row Total and Column Total using dynamic Pivot query in SQL Server