Konvertera det inte, men behandla det som ett intervall (som du skulle göra datetime-värden)
DECLARE @foo TABLE (TestData varbinary(100) NOT NULL);
INSERT @foo (TestData) VALUES
(0x0001DC780C0030373156635D0C00B8840301009A0600AC),
(0x0001AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA),
(0x0001AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF),
(0x0301DC780C0030373156385D0C006499C401009A0600AC),
(0x0301FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF),
(0x0302000000000000000000000000000000000000000000);
SELECT *
FROM @foo
WHERE TestData >= 0x0001 AND TestData < 0x0002;
-- added more digit for clarity of what actually happens
SELECT *
FROM @foo
WHERE TestData >= 0x00010000 AND TestData < 0x00020000;
SELECT *
FROM @foo
WHERE TestData >= 0x0001AA AND TestData < 0x0001AB;
SELECT *
FROM @foo
WHERE TestData >= 0x0301 AND TestData < 0x0302;
Detta har bonusen att kunna använda ett index på TestData
Redigera, du anger bara så många siffror du behöver