Devices added on certain period of time

Devices added on certain period of time

We will use device notes added during discovery to know the exact time of adding this device to WUG.

SELECT Temp.nDeviceID,
       Temp.sNote
FROM (
SELECT nDeviceID,
       CAST(REPLACE(REPLACE(CAST(sNote AS NVARCHAR(MAX)),'This device was scanned by discovery on',
       ''),'.','') AS datetime) AS sNote
FROM Device
) AS Temp

WHERE Temp.sNote BETWEEN '6/1/2015' AND '6/21/2015'