Query problem in SSRS

  • I have a query in SSRS that works with 1 where clause but not another. Can anyone help this newbie?

    This works

    Where DATEADD(HOUR, -5, e.starttime) between DATEADD(mm, - 3, GETDATE()) and GETDATE ()

    This one does not.

    Where DATEADD(HOUR, -5, e.starttime) between DATEADD(mm, - 3, @QTR_EndDate()) and @QTR_EndDate)

    Error 102: Incorreact yntax near '('

    I have tried everything but can't get it to work.

    :w00t:

    Changinagain

  • Where DATEADD(HOUR, -5, e.starttime) between DATEADD(mm, - 3, @QTR_EndDate) and @QTR_EndDate)

    should work. You had brackets () after the @QTR_EndDate in the DATEADD. Should fix the problem.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply