Jyoti Jodha

Jyoti Jodha

  • NA
  • 1.7k
  • 408.5k

Error converting data type nvarchar to numeric. in Sql Serve

May 31 2017 1:24 AM
Error show
Msg 8114, Level 16, State 5, Line 1
Error converting data type nvarchar to numeric.
 
query
--------
 
Select ROW_NUMBER() over(ORDER BY DATENAME(MONTH, convert(datetime,Date,105))+'-'+DATENAME(year, convert(datetime,Date,105)) ASC) as ID,
DATENAME(MONTH, convert(datetime,Date,105))+'-'+DATENAME(year, convert(datetime,Date,105)) as Month,
sum(cast(Amount as numeric(18,2))) as Amount,
sum(cast(Addcost as numeric(18,2))) as Addcost ,
sum(cast(Discount as numeric(18,2))) as Discount ,
sum(cast(Tax_Amount as numeric(18,2))) as Tax_Amount,
sum(cast(Total_Amount as numeric(18,2))) as Total_Amount from MainBillForm where Sno=0 group by DATENAME(MONTH, convert(datetime,Date,105))+'-'+DATENAME(year, convert(datetime,Date,105))
ORDER BY DATENAME(MONTH, convert(datetime,Date,105))+'-'+DATENAME(year, convert(datetime,Date,105))

Answers (6)