Hello. I have the following table:
CREATE TABLE [dbo].[TempTable](
[ID] [int] IDENTITY(1,1) NOT NULL,
[TimeStamp] [datetime] NULL,
[Direction] [nvarchar](5) NULL,
[TimeOut] [datetime] NULL,
[Name] [nvarchar](50) NULL)
When a person is checked into the system I create a record with a Name a current TimeStamp and TimeOut set to null. When a person is checked out of the system I create a record with a Name, a current TimeStamp and a current TimeOut.
My question is, what sql statement would generate all people currently checked into the system? Or is there a better way to handle this?