CASE WHEN isNULL(s.repost,0) = 1
THEN
DateDiff(hh,SU.sessionStart,GETDATE())
ELSE
datediff(d, getdate(), SU.sessionStart)
END
>= CASE WHEN isNULL(s.repost,0) = 1
THEN
24
ELSE
3
END
Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.
TRUSTED BY
Please remember that THE BEST WAY TO ASK is to provide:
a. sample data
b. the expected result
If we understand the question easily you get an answer faster and you don't need to clarify the question for us.