• jc85 (5/31/2016)


    WHERE month(b.start_time) = @Loc_Month

    AND year(b.start_time) = @Loc_Year

    Is there any other way to avoid using function in WHERE clause in this scenario?

    It doesn't have huge impact on query speed but as pointed out earlier, it is not a good practice.

    Yes, of course.

    Build @StartDate and @EndDate out of @Loc_Year and @Loc_Month and... You know what to do then.

    _____________
    Code for TallyGenerator