T-SQL Right 3 Digits to Zeros
SELECT
(SELECT RIGHT(‘00000’ + CONVERT(VARCHAR(5),FLOOR(CAST([EP_departmentnumbertext] AS INT)/1000)*1000), 5)) AS DIVISION,
* from [databasename].[dbo].[people] ep where EP_NAME like ‘%Adams%’
SELECT
(SELECT RIGHT(‘00000’ + CONVERT(VARCHAR(5),FLOOR(CAST([EP_departmentnumbertext] AS INT)/1000)*1000), 5)) AS DIVISION,
* from [databasename].[dbo].[people] ep where EP_NAME like ‘%Adams%’