I have a query select, with date between used in the where condition, which is taking a long time to execute and render data. If i run without any date conditions against the entire table is much faster.
where rm.ProgID <> 70
and (rm.progid = 71)
and rm.rmloggeddate >= CONVERT(varchar(8), '04/01/16', 112)
and rm.rmloggeddate < CONVERT(varchar(8), dateadd(day, 1, '04/11/16'), 112)
rmloggeddate is a datetime column in table.
Can you please advice any other better method to run the query with in a date range.