Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
select f.C_EmpNo as EmpCode,f.C_Name as FSName,ua.N_Type as NType,
ua.c_sh_name as Desg,
ui.C_UserID as UserID,dwr.dcrcount as DCR_Count
from 
Tbl_FS_Mst f
join Tbl_User_Access ua on f.N_Type=ua.N_Type
join Tbl_User_Info ui on f.C_EmpNo=ui.C_Code
left join
(
	select c_fs_code,COUNT(distinct n_srno) as dcrcount
	from tbl_dwr d
	where MONTH(d_date_report)=3 and year(d_date_report)=2015
	group by c_fs_code
)dwr on dwr.C_FS_Code=f.C_Code
where f.C_EmpNo<>'000000' or dwr.dcrcount is not null
--and  dwr.dcrcount=null
order by f.C_EmpNo,f.N_Type,f.C_Name


I want to transfer this query output into excel..
Posted
Updated 19-Mar-15 0:19am
v2
Comments
John C Rayan 19-Mar-15 6:12am    
Do you want to do it programmatically or using SSMS?
Member 11337367 19-Mar-15 6:13am    
programitcally.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900