print DATEADD(MONTH, - 5, CURRENT_TIMESTAMP)
print DATEADD(MONTH, - 6, CURRENT_TIMESTAMP)
The two lines above print May 20th 2012 and June 20th 2012
WHERE (A1cList.LastItemDate BETWEEN '5/20/2012' and '6/20/2012')
This where clause above returns 1 row, as expected
where (A1cList.LastItemDate BETWEEN CONVERT(VARCHAR(10), DATEADD(MONTH, - 5, CURRENT_TIMESTAMP), 101) AND CONVERT(VARCHAR(10), DATEADD(MONTH, - 6, CURRENT_TIMESTAMP), 101))
where (A1cList.LastItemDate BETWEEN DATEADD(MONTH, - 5, CURRENT_TIMESTAMP) AND DATEADD(MONTH, - 6, CURRENT_TIMESTAMP))
These two return zero rows, but it seems to be that they should return 1 row each, as well. The row returned with the first where clause has a date of 6/6/2012 00:00. Why don't I get the row when I don't hard code the date?
Greg