anyone know how to retrieve data from the database within the past 30 minutes. I tried solution such as DateTime >= DateADD(MINUTE,-30,GETDATE()) but does not help as after 30 minutes i still updating and also replacing the DateTime Column.
Asked
Active
Viewed 402 times
0
-
which database are you using. – Vipul Pandey Oct 16 '18 at 08:26
-
Microsoft SQL database – Lee Yue Loong Oct 16 '18 at 08:27
-
https://stackoverflow.com/questions/749615/does-ms-sql-servers-between-include-the-range-boundaries/749663 try this post – MartinS Oct 16 '18 at 08:28
1 Answers
0
Try below
select * from ablename where DateTime >= DateADD(MINUTE,-30,GETDATE()) and DateTime<getdate()

Fahmi
- 37,315
- 5
- 22
- 31
-
I tried to send values for the past 7 minutes and it return nothing when it is executed – Lee Yue Loong Oct 17 '18 at 02:01