Hi all, I have a query which I want to declare the datepart as part of the datediff variable but I'm getting an error, so i'm guessing I can't use a variable in the datediff function?. Is there another way around this?
Declare @DateDiffPart as VARCHAR(50) = 'day'
Declare @DateDiffVar as INT = 1
datediff(DateDiffPart,calldisconnectedtimeutc,getdate()) = @DateDiffVar