input as Year
eg :2022 by passing from page to stored procedure as integer
@Year int =2022
i want to get result like
01/01/2022
31/12/2022
input as Year
eg :2022 by passing from page to stored procedure as integer
@Year int =2022
i want to get result like
01/01/2022
31/12/2022
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Nov 28, 2022, 11:04 PM EST
Check this
DECLARE @Year INT = 2022 SELECT DATEFROMPARTS(@Year, 1, 1) AS 'First Day of Year', DATEFROMPARTS(@Year, 12, 31) AS 'Last Day of Year';