I have 1 million of row and I have a field that keep datetime value.
I have an index for this field and I want to filter rows between two dates.
The problem is that this field also keeps time information and I don't want to filter with
time. If I use the convert to take off the time, my query doesn't use the index date.
What can I do?
I tried this:
SELECT * FROM MOVIMENT
WHERE CONVERT(VARCHAR(10), DATEMOV, 112) >='20120101'
AND CONVERT(VARCHAR(10), DATEMOV, 112) <='20120416'
This query solves my problem, but it takes a long time because it put appart the index.