I'll try to sum this up as best I can...
I first create a SQL query in SSMS (SQL Management studio) and it works and runs in mere seconds (2-7 seconds usually) So I then take the query and put it into an SSRS report using SQL Report Builder (3.0 for SQL 2016). I've done this many times and never had an issue.
On this query when running it from SSRS it causes the CPU on the SQL server to max out 99 to 100%
but only when I include date parameter variables in the dataset query. So the Where clause in the query says something like where date between @BeginDate and @EndDate
Then I set the parameters up in the SSRS options to prompt user for those values (or I set default values like Today() etc...)
I've brought the entire query down to a very minimal set of data to test it out and once I put in the date filter in the where clause then it breaks...