How to retrieve records for last 30 minutes in MS SQL?
Solution 1:
Change this (CURRENT_TIMESTAMP-30)
To This: DateADD(mi, -30, Current_TimeStamp)
To get the current date use GetDate().
MSDN Link to DateAdd Function
MSDN Link to Get Date Function
Solution 2:
Have a look at using DATEADD
something like
SELECT DATEADD(minute, -30, GETDATE())
Solution 3:
Use:
SELECT *
FROM [Janus999DB].[dbo].[tblCustomerPlay]
WHERE DatePlayed < GetDate()
AND DatePlayed > dateadd(minute, -30, GetDate())