Hello,
I've been trying to track down an issue with using Filtered Views and Reports, and I believe the issue is a bug in the SQL scalar function dbo.fn_UTCToTzCodeSpecificLocalTime. The issue is we have dates in our environment that are 9999-12-31, and this function his this line:
select @FuzzySearchDateTime = dateadd(day, 1, @UTCTime);
Well adding 1 day to 9999-12-31 is not possible, so when I call the Filtered View on this entity table I get this error:
Msg 517, Level 16, State 1, Line 1
Adding a value to a 'datetime' column caused an overflow.
I see this as a bug because it's checking for the minimum possible date in the function but not the highest possible date before this line of code. So my options are editing the function which is easy but not a supported fix or changing all my data and processes to not use 9999-12-31 but use something earlier (9998-12-31 for example). At any rate I wasn't sure who to pass this bug to or if someone from Microsoft could suggest a supported way to edit this View so it wouldn't blow-up on me.
Thanks --
Sam
*This post is locked for comments