select * from matchdate
where (matchdate) = DATEADD(DAY, +2, getdate())
Asked
Active
Viewed 35 times
-1

PM 77-1
- 12,933
- 21
- 68
- 111

Nisarg Shah
- 1
- 1
-
2Please tell how it is different than https://stackoverflow.com/q/47818266/4636715 – vahdet Sep 24 '19 at 13:59
2 Answers
0
You want an inequality:
where matchdate >= convert(date, getdate()) and
matchdate < convert(date, DATEADD(DAY, +2, getdate()))
This assumes that you want calendar days. If you want 48 hours:
where matchdate >= getdate() and
matchdate < DATEADD(hour, 48, getdate())

Gordon Linoff
- 1,242,037
- 58
- 646
- 786
0
1st You should not call table with same column name in it, next time try something with T_matchdate as table. 2nd not equal but greater
select *
from (select * from matchdate)T_matchdate
where matchdate > DATEADD(DAY, +2, getdate())
and matchdate <= GetDate()
You can try to find date by more SQLish way
select *
from (select * from matchdate) T_matchdate
where (matchdate) > sysdate
and matchdate < sysdate+2

ImmoXZ
- 75
- 1
- 8