erikTsomik
asked on
sql DateDiff help
I need to show the record that is 24 hours priors of session start.
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
select ...
where dateadd(d,1,SU.sessionStar t) >= getdate()
where dateadd(d,1,SU.sessionStar
erikTsomik, do you still need help with this question?
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.