вы можете использовать format()
, если ваш sql server
выше 2012
.
SELECT EMPLOYEE_ID,EMPLOYEE_NAME, LEVEL, ORIGINAL_HIRE_DATE
FROM Table
WHERE
(LEVEL not in ('101','102') and ACTIVE > 0 and LOCATION_CODE = '1030'
UNION ALL
SELECT EMPLOYEE_ID,EMPLOYEE_NAME, LEVEL, ORIGINAL_HIRE_DATE
FROM Table
WHERE
(LEVEL in ('101','102') and (LEFT(CONVERT(varchar, ORIGINAL_HIRE_DATE,112),6) != LEFT(CONVERT(varchar, GetDate(),112),6))
and ACTIVE > 0 and LOCATION_CODE = '1030'
или вы можете использовать OR
оператор
SELECT EMPLOYEE_ID,EMPLOYEE_NAME, LEVEL, ORIGINAL_HIRE_DATE
FROM Table
WHERE
(LEVEL not in ('101','102')
OR
(LEVEL in ('101','102') and (LEFT(CONVERT(varchar, ORIGINAL_HIRE_DATE,112),6) != LEFT(CONVERT(varchar, GetDate(),112),6)))
and ACTIVE > 0 and LOCATION_CODE = '1030'