I am receiving this error and I can't seem to fix it. Here is the snippet of code I am running.
SELECTSUM(ade.network_price)[Cumulative_31_90_Days],
b.Claim#
FROMdbo.All_Data_Export ade JOIN #Benchmark b
ON ade.claim# = b.Claim#
WHEREinvoice_date BETWEEN DATEADD(dd,31,ade.DOI) AND DATEADD(dd,90,ade.DOI)
GROUP BY b.Claim#
Both Invoice_date and DOI are datetime data types. I appreciate any help. Thank you