无法在float上调用方法

时间:2015-01-14 19:51:38

标签: sql sql-server sql-server-2008

运行此查询时获取“无法在float上调用方法”。我做了一个搜索,他们在本专栏中有一些空行,但我认为这是问题所在。我也尝试了以下2个更改,但仍然遇到了这个错误。我需要在这些空白字段中添加零吗? Sale_price1字段也是一个字符。

SUM(ISNULL(((CASE WHEN ISNUMERIC(oe11.SALE_PRICE1) = 0 THEN NULL ELSE CAST(oe11.SALE_PRICE1 AS MONEY) END)),0))
SUM(CAST(OE11.SALE_PRICE1 AS MONEY)) AS GROSS

这是完整的代码

     SELECT DISTINCT
     OE10.ORD_NUMB
    --,COUNT(DISTINCT OE10.0RD_NUMB) 
    ,OE10.ORD_SHIPPED_FLAG
    ,OE10.DATE_SHIPPED
    ,OE10.PROD_CODE
    ,OE10.IND_CODE
    ,ISNULL(OE11.SALE_PRICE1, 0)
    ,OE11.FG_ITEM_DESC
    --,AR10.TRANS_DLR



FROM OE10


LEFT OUTER JOIN 
REPORTING.DBO.dimDate AS DIMDATE ON CONVERT(CHAR(10), DATEADD(d, OE10.RDAT_SHIPPED +5843, 0), 112) = dimdate.DateId 
LEFT OUTER JOIN REPORTING.DBO.dimMisc AS MID ON OE10.PROD_CODE = MID.ProductCode  
LEFT OUTER JOIN OE11 AS OE11 ON OE10.ORD_NUMB = OE11.ORD_NUMB
LEFT OUTER JOIN AR10 AS AR10 ON AR10.JOB_NUMB = AR10.JOB_NUMB 



WHERE OE10.ORD_SHIPPED_FLAG = 'Y'
AND DIMDATE.ISCURRENTDAY = 1
AND MID.BUSINESSUNITNAME = 'Standard Products'

0 个答案:

没有答案