79253167

Date: 2024-12-05 01:38:22
Score: 1
Natty:
Report link

This should do the trick:

declare @is_thanksgiving bit,
    @cur_date datetime = getdate()

select @is_thanksgiving = case when datename(month, @cur_date) = 'November'
        and datename(weekday, @cur_date) = 'Thursday'
        and day(@cur_date) between 22 and 28
    then 1 else 0 end

The 4th Thursday should be between:

This is very similar to Christian Pena's answer, but I think his is off by 1.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: user2005169