I have a table that logs phone data. This table gets a row inserted every time a person who is logged into the phone system changes their state. So if I pick up the phone or hang up the phone, each one of those events is logged in the table. The table has a column named EventDateTime. This has the datetime of each event.
I would like to pull all rows that are only 15 minutes old. I am having trouble with this. I have attached the create table statement and the top 1000 rows from my table. Based on when this question gets viewed, the expert will have to adjust the time values. I really need to do this by minute, so if 1 hour gets the results, please use 60 minutes.
CREATE TABLE [dbo].[AgentStateDetail](
[agentID] [int] NOT NULL,
[eventDateTime] [datetime] NOT NULL,
[gmtOffset] [smallint] NOT NULL,
[eventType] [tinyint] NOT NULL,
[reasonCode] [smallint] NOT NULL DEFAULT (0),
[profileID] [int] NOT NULL,
CONSTRAINT [PK_AgentStatusDetail] PRIMARY KEY NONCLUSTERED