If you "must" (there is no good reason why you can't) change the data type, you'll have to convert the value of your column. This is going to come at a huge cost, as your query will no longer be SARGable (this means that any indexes you have on [DATE]
will not be used).
SELECT *
FROM YourTable
WHERE TRY_CONVERT(date,[DATE],105) BETWEEN '20181210' AND '20181211';
--Note the unambiguous date format for the literal strings
I've used TRY_CONVERT
as style 105 assumes all your dates are in the format dd-MM-yyyy
, but won't cause an error if there are any that are invalid.
Alternatively, if you can, add a computed column and index it. you can add a persisted date column by doing:
ALTER TABLE YourTable ADD DateDate AS TRY_CONVERT(date,[DATE],105) PERSISTED;
Then (after adding your index(es)) you can query that column instead:
SELECT *
FROM YourTable
WHERE DateDate BETWEEN '20181210' AND '20181211';