Can someone tell what I'm doing wrong in SQL Server to fail to make the below on today (which is 2023-03-16) not read 3-20-2023?
Basically I need to return today's date only the day always has to be 20.
DECLARE @year int = CONVERT(int,datepart(yyyy, GETDATE()))
DECLARE @month int = CONVERT(int,datepart(m, GETDATE()))
DECLARE @day int = 20
SELECT DATEFROMPARTS(@month, @day, @year)
this works: