I am trying to build a query where I can get a count of logged in users. There is a field called eventtype. If it is set to one, then the user is logged in. If it is set to seven, then they are logged out. There are a number of other eventtypes that I can ignore. There is a datetime stamp for each eventtype (see sample data below). I might be able to do this in MS-SQL, but the database is Informix which I am not as well versed in. Any assistance would be appreciated.
Sample Data
UserID DateTime Eventtype
11604 6/27/2016 3.05.53 PM 1 login
11604 6/27/2016 3.05.53 PM 2
11604 6/27/2016 3.06.21 PM 3
11604 6/27/2016 3.07.51 PM 4
11604 6/27/2016 3.08.01 PM 5
11604 6/27/2016 3.11.59 PM 6
11604 6/27/2016 3.16.45 PM 3
11604 6/27/2016 3.20.53 PM 7 logout
11604 6/27/2016 3.25.53 PM 1 login
...etc.
Sample Data
UserID DateTime Eventtype
11604 6/27/2016 3.05.53 PM 1 login
11604 6/27/2016 3.05.53 PM 2
11604 6/27/2016 3.06.21 PM 3
11604 6/27/2016 3.07.51 PM 4
11604 6/27/2016 3.08.01 PM 5
11604 6/27/2016 3.11.59 PM 6
11604 6/27/2016 3.16.45 PM 3
11604 6/27/2016 3.20.53 PM 7 logout
11604 6/27/2016 3.25.53 PM 1 login
...etc.