Something like this?DECLARE @EnterDate DATETIMEDECLARE @CurrentDate DATETIME--SET @EnterDate = '20070902'SET @EnterDate = '20070601'SET @CurrentDate = GETDATE()SELECT CASE WHEN @EnterDate BETWEEN DATEADD(YEAR, -3, @CurrentDate) AND @CurrentDate THEN 'Valid' ELSE 'Not Valid' END
If you want to strip off the time portion of the DATETIME you can do soemthing like:SELECT DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 0)