August 17, 2021 at 6:56 am
Hi
if Month(@frDate) < 4
begin
SET @ytdfrDate = (SELECT CONVERT(DATE, dateadd(y,-1,@frdate + '-04-01'))
end
Thanks
August 17, 2021 at 8:00 am
count the brackets
August 17, 2021 at 8:01 am
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy