select dS.C_DSC_Code,D.C_FS_Code,DAY(D.D_Date_Report) from tbl_dwr d join tbl_dwr_details ds on ds.N_Srno=d.N_Srno join Tbl_Doc_Stock_Chem_Add_Mst sd on sd.C_Code=ds.C_DSC_Code join Tbl_Cust_Div c on c.c_cust_code=sd.C_Code where (('2015/10/01' between c.d_date and isnull(c.d_date_to,'2015/10/31')) or ('2015/10/31' between c.d_date and isnull(c.d_date_to,'2015/10/31')) ) and MONTH(d.D_Date_Report)=10 and YEAR(d.D_Date_Report)=2015 and sd.N_Type=1 and d.C_FS_Code='ME0001' ORDER BY DS.C_DSC_Code
C_DSC_Code C_FS_Code day D000033778 ME0001 15 D000033865 ME0001 6 D000033865 ME0001 23 D000033866 ME0001 7 D000033866 ME0001 16 D000033867 ME0001 7 D000033867 ME0001 16 D31863 ME0001 3 D31863 ME0001 14 D31863 ME0001 20 D31864 ME0001 3
C_DSC_Code C_FS_Code day D000033778 ME0001 15 D000033865 ME0001 6,23 D000033866 ME0001 7,16 D000033867 ME0001 7,16 D31863 ME0001 3,14,20 D31864 ME0001 3
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)