siva nathan

siva nathan

  • 794
  • 828
  • 235.6k

i cant group a column in sql server

Apr 4 2017 12:50 AM
my table record is below in screen shot 
my query is belw
 
declare @FromDate datetime
set @FromDate='03-01-17'
declare @Todate datetime
set @Todate='03-19-17'
select
sum(round(OThrs,0)) as OThrs, convert(int,round((( ME.AuditSalary+HRA)/8),0)* convert(int,round(isnull(OThrs,0),0)*2)) as OTSalary
from master_salary as MS
inner join Master_Employee as ME on ME.id=MS.Refid
Where convert(varchar(10),MS.Attdate,110) between @FromDate and @Todate and ME.Category in(2)
group by ME.AuditSalary ,HRA,OThrs

Attachment: Screenshot_(59).rar

Answers (6)