?? on set parameter to today if date in future?

  • Hi

    Does anyone know how I can setup this where statement to

    have @enddate be now() if the date is in the future?

    (calendarDate BETWEEN @startdate AND @enddate)

    Thanks

    Joe

  • jbalbo (4/5/2013)


    Hi

    Does anyone know how I can setup this where statement to

    have @enddate be now() if the date is in the future?

    (calendarDate BETWEEN @startdate AND @enddate)

    Thanks

    Joe

    Curious how hard you really tried to solve this yourself.

    calendarDate BETWEEN @startdate AND case when @enddate > getdate() then getdate() else @enddate end

  • Thanks and sorry....

    I was caught up with something and should have thought it out before I posted it

  • jbalbo (4/5/2013)


    Thanks and sorry....

    I was caught up with something and should have thought it out before I posted it

    Just one of those so simple ones. Happens at times.

Viewing 4 posts - 1 through 3 (of 3 total)

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