jagjitsingh
Ten Centuries
Points: 1059
More actions
August 17, 2021 at 6:56 am
#3920625
Hi
if Month(@frDate) < 4
begin
SET @ytdfrDate = (SELECT CONVERT(DATE, dateadd(y,-1,@frdate + '-04-01'))
end
Thanks
frederico_fonseca
SSCoach
Points: 16154
August 17, 2021 at 8:00 am
#3920643
count the brackets
Ant-Green
SSC Guru
Points: 113507
August 17, 2021 at 8:01 am
#3920644
Your missing a )
Remember to count the number of ( you have and then ensure you have the same amount of )
Also stop cross posting and creating duplicate posts, this could of been done on the other 2 posts you have created with this code
https://www.sqlservercentral.com/forums/topic/ytd-sale
https://www.sqlservercentral.com/forums/topic/ytd-date-calculation
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply