I am trying to use this for a calc field and i keep getting an error.
Case when InvcHead.FiscalYear = Year(dateadd(year, -1, GetDate())) then sum((InvcHead.DocDepositCredit+InvcHead.DocInvoiceAmt)) else ‘’ end
Ice.Common.EpicorServerException: Error converting data type nvarchar to numeric. —> System.Data.SqlClient.SqlException: Error converting data type nvarchar to numeric.
I’m needing to sum all the invoice amounts for particular fiscal years, but it needs to be like a rolling five fiscal years. So can’t hard code it needed to be where it’s year -1, year - 2, etc.
Thank you all! I ended up using @AndyGHA and @DaveOlender to get it to work. However, I was very intrigued by @Banderson thoughts on it. Playing with that one for future work.