Online Home
CAST(MONTH(@Batch_Start_date) AS INT)
SET @Year = CAST(YEAR(@Batch_Start_date) AS INT)
or
select year('2022-01-01') or select month('2022-01-01')
reference:-https://www.w3schools.com/sql/func_sqlserver_cast.asp
No comments:
Post a Comment