Microsoft SQL Server语法错误

时间:2014-05-14 06:29:44

标签: sql sql-server

有人可以帮助解决以下查询的语法错误吗?非常感谢你!

Msg 102,Level 15,State 1,Line 8 ')'附近的语法不正确。

    with cte_EOMDenials as
    (select d.* from rrscsql2.Denials.dbo.tblDenialMonthEnd d --Pulls LP Denials EOM detail
    Inner join rrscsql3.Facilities.dbo.vwFacilities f
    on d.UnitNum = f.UnitNum and f.Owner like '%LifePoint%'
    Inner join rrscsql2.Denials.dbo.tblDispositionDictionary t
    on d.disposition=t.disposition and DispositionType like'O%'
    Where datediff(mm, monthending, GETDATE()) = 1
    and DATEDIFF(mm,DischDate,monthending)>2))

1 个答案:

答案 0 :(得分:0)

;with cte_EOMDenials as
    (select d.* from rrscsql2.Denials.dbo.tblDenialMonthEnd d --Pulls LP Denials EOM detail
    Inner join rrscsql3.Facilities.dbo.vwFacilities f
    on d.UnitNum = f.UnitNum and f.Owner like '%LifePoint%'
    Inner join rrscsql2.Denials.dbo.tblDispositionDictionary t
    on d.disposition=t.disposition and DispositionType like'O%'
    Where datediff(mm, monthending, GETDATE()) = 1
    and DATEDIFF(mm,DischDate,monthending)>2)


select * from cte_EOMDenials