Date Parameter

  • i have 2 parameters, begin date and end date.

    range should be from 1/1/1753 to 12/31/9999

    if the date field in null, it displays 1/1/0001

    so how do i set the default begin date to 1/1/0001 (or null) if the allowed range should only be from 1/1/1753?

  • SET @SDate = ISNULL(@SDate, '1900-01-01')

    SET @EDate = ISNULL(@EDate, '2100-01-01')

    SELECT ... WHERE @DateCol BETWEEN @SDate AND @EDate

  • wow ... thnx for the reply

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

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