Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 concurrently logged in users

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-06 : 00:32:42
The following is the login history of people who logged into the website. I would like to find the hightest number of users concurrently logged-in.

2004-03-30 13:12:55.500
2004-03-30 13:12:56.153
2004-03-30 13:13:04.500
2004-03-30 13:13:04.763
2004-03-30 13:13:22.403
2004-03-30 13:13:23.107
2004-03-30 13:13:23.170
2004-03-30 13:13:35.000
2004-03-30 13:13:35.233
2004-03-30 13:14:05.500
2004-03-30 13:14:06.000
2004-03-30 13:14:34.280
2004-03-30 13:14:34.543
2004-03-30 13:14:34.590
2004-03-30 13:14:40.217
2004-03-30 13:14:40.280
2004-03-30 13:14:53.840
2004-03-30 13:14:53.890
2004-03-30 13:15:08.013
2004-03-30 13:15:08.060
2004-03-30 13:15:36.623
2004-03-30 13:15:37.280
2004-03-30 13:15:37.920
2004-03-30 13:15:37.967
2004-03-30 13:15:46.217
2004-03-30 13:15:46.263
2004-03-30 13:16:06.437
2004-03-30 13:16:07.030
2004-03-30 13:16:07.090
2004-03-30 13:16:29.640
2004-03-30 13:16:29.967
2004-03-30 13:16:30.030
2004-03-30 13:16:38.390
2004-03-30 13:16:38.640
2004-03-30 13:16:38.687
2004-03-30 13:16:50.590
2004-03-30 13:16:50.653
2004-03-30 13:17:21.810
2004-03-30 13:17:21.857
2004-03-30 13:17:46.530
2004-03-30 13:17:46.793
2004-03-30 13:17:47.357
2004-03-30 13:17:47.403
2004-03-30 13:18:00.857
2004-03-30 13:18:00.903
2004-03-30 13:18:16.420
2004-03-30 13:18:17.233
2004-03-30 13:18:17.293
2004-03-30 13:18:51.780
2004-03-30 13:18:52.077
2004-03-30 13:19:00.437
2004-03-30 13:19:00.763
2004-03-30 13:19:21.873
2004-03-30 13:19:22.437
2004-03-30 13:19:22.500
2004-03-30 13:19:30.437
2004-03-30 13:19:31.000
2004-03-30 13:19:35.013
2004-03-30 13:19:35.560
2004-03-30 13:19:44.153
2004-03-30 13:19:44.717
2004-03-30 13:19:44.780
2004-03-30 13:20:38.500
2004-03-30 13:20:39.000
2004-03-30 13:20:44.233
2004-03-30 13:20:44.983
2004-03-30 13:21:03.250
2004-03-30 13:21:03.500
2004-03-30 13:21:03.543
2004-03-30 13:21:10.310
2004-03-30 13:21:10.857
2004-03-30 13:21:15.200
2004-03-30 13:21:15.437
2004-03-30 13:21:24.687
2004-03-30 13:21:24.950
2004-03-30 13:21:25.000
2004-03-30 13:51:34.357
2004-03-30 13:51:34.717
2004-03-30 13:51:39.543
2004-03-30 13:51:45.700
2004-03-30 13:51:46.107
2004-03-30 13:51:56.403
2004-03-30 13:51:56.733
2004-03-30 13:51:57.077
2004-03-30 13:51:57.123
2004-03-30 13:52:07.687
2004-03-30 13:52:07.903
2004-03-30 13:52:13.543
2004-03-30 13:52:21.890
2004-03-30 13:52:22.153
2004-03-30 13:52:47.670
2004-03-30 13:52:47.920
2004-03-30 13:52:47.983
2004-03-30 13:52:50.500
2004-03-30 13:52:50.560
2004-03-30 13:59:46.687
2004-03-30 13:59:53.107
2004-03-30 14:00:02.340
2004-03-30 14:00:09.780
2004-03-30 14:00:10.077
2004-03-30 14:00:14.357
2004-03-30 14:00:14.670
2004-03-30 14:00:25.310
2004-03-30 14:00:25.590
2004-03-30 14:00:25.687
2004-03-30 14:00:33.967
2004-03-30 14:00:34.217
2004-03-30 14:00:45.390
2004-03-30 14:00:45.700
2004-03-30 14:01:16.577
2004-03-30 14:01:16.890
2004-03-30 14:01:16.937
2004-03-30 14:02:48.467
2004-03-30 14:02:48.513
2004-03-30 14:02:53.967
2004-03-30 14:02:54.030
2004-03-30 14:04:15.340
2004-03-30 14:04:15.390
2004-03-30 14:04:15.437
2004-03-30 14:04:18.890
2004-03-30 14:04:18.950
2004-03-30 14:04:37.903
2004-03-30 14:04:37.967
2004-03-30 14:04:38.217
2004-03-30 14:04:38.263
2004-03-30 14:04:38.327
2004-03-30 14:04:51.513
2004-03-30 14:04:51.560
2004-03-30 14:04:51.607
2004-03-30 14:04:56.793
2004-03-30 14:04:56.840
2004-03-30 14:04:56.903
2004-03-30 14:05:21.390
2004-03-30 14:05:21.450
2004-03-30 14:05:21.500
2004-03-30 14:05:34.903
2004-03-30 14:05:34.950
2004-03-30 14:05:35.013
2004-03-30 14:05:35.280
2004-03-30 14:05:35.327
2004-03-30 14:05:35.390
2004-03-30 14:05:37.733
2004-03-30 14:05:37.793
2004-03-30 14:05:41.187
2004-03-30 14:05:41.250
2004-03-30 14:05:44.140
2004-03-30 14:05:44.187
2004-03-30 14:05:55.967
2004-03-30 14:05:56.030
2004-03-30 14:06:05.200
2004-03-30 14:06:05.263
2004-03-30 14:06:08.623
2004-03-30 14:06:08.920
2004-03-30 14:06:08.967
2004-03-30 14:06:11.263
2004-03-30 14:06:11.310
2004-03-30 14:06:14.530
2004-03-30 14:06:14.840
2004-03-30 14:06:14.890
2004-03-30 14:06:16.607
2004-03-30 14:06:16.653
2004-03-30 14:06:22.373
2004-03-30 14:06:22.640
2004-03-30 14:06:22.700
2004-03-30 14:06:27.857
2004-03-31 06:12:13.450
2004-03-31 06:12:47.733
2004-03-31 06:13:25.640
2004-03-31 06:17:45.857
2004-03-31 06:17:47.390
2004-03-31 06:19:28.590
2004-03-31 06:23:56.357
2004-03-31 06:23:56.560
2004-03-31 06:25:23.107
2004-03-31 06:28:10.030
2004-03-31 06:29:55.513
2004-03-31 06:30:21.450
2004-03-31 06:30:22.530
2004-03-31 06:32:16.500
2004-03-31 06:33:01.840
2004-03-31 06:35:11.653
2004-03-31 06:35:42.013
2004-03-31 06:36:03.653
2004-03-31 06:36:03.733
2004-03-31 06:36:14.310
2004-03-31 06:36:46.030
2004-03-31 06:37:16.793
2004-03-31 06:38:06.000
2004-03-31 06:39:03.840
2004-03-31 06:39:48.403
2004-03-31 06:40:50.030
2004-03-31 06:43:18.890
2004-03-31 06:43:49.733
2004-03-31 06:44:29.373
2004-03-31 06:44:58.590
2004-03-31 06:45:58.950
2004-03-31 06:46:11.670
2004-03-31 06:47:03.920
2004-03-31 06:49:05.873
2004-03-31 06:51:03.750
2004-03-31 06:52:13.437
2004-03-31 06:53:12.263
2004-03-31 06:54:43.873
2004-03-31 06:54:44.170
2004-03-31 06:55:14.250
2004-03-31 06:55:16.200
2004-03-31 06:56:27.043
2004-03-31 06:57:08.780
2004-03-31 06:57:11.000
2004-03-31 06:57:14.437
2004-03-31 06:57:26.577
2004-03-31 06:58:41.560
2004-03-31 07:00:00.030
2004-03-31 07:00:33.340
2004-03-31 07:00:39.233
2004-03-31 07:02:00.780
2004-03-31 07:02:51.090
2004-03-31 07:03:00.543
2004-03-31 07:03:02.623
2004-03-31 07:03:42.733
2004-03-31 07:03:47.530
2004-03-31 07:03:48.500
2004-03-31 07:05:32.293
2004-03-31 07:06:00.890
2004-03-31 07:07:04.030
2004-03-31 07:07:07.793
2004-03-31 07:07:19.543
2004-03-31 07:07:46.140
2004-03-31 07:08:41.840
2004-03-31 07:10:12.170
2004-03-31 07:10:51.590
2004-03-31 07:11:03.373
2004-03-31 07:11:25.310
2004-03-31 07:11:33.543
2004-03-31 07:11:45.077
2004-03-31 07:13:21.560
2004-03-31 07:13:41.217
2004-03-31 07:13:51.043
2004-03-31 07:14:05.153
2004-03-31 07:14:48.827
2004-03-31 07:15:37.793
2004-03-31 07:15:43.293
2004-03-31 07:16:05.640
2004-03-31 07:17:01.500
2004-03-31 07:17:16.670
2004-03-31 07:17:47.233
2004-03-31 07:17:50.077
2004-03-31 07:18:56.340
2004-03-31 07:18:57.340
2004-03-31 07:19:00.293
2004-03-31 07:19:27.310
2004-03-31 07:19:37.607
2004-03-31 07:19:59.590
2004-03-31 07:20:11.293
2004-03-31 07:20:16.577
2004-03-31 07:20:34.310
2004-03-31 07:20:54.107
2004-03-31 07:21:31.357
2004-03-31 07:21:45.043
2004-03-31 07:22:06.280
2004-03-31 07:22:52.937
2004-03-31 07:23:30.263
2004-03-31 07:23:32.233
2004-03-31 07:24:25.750
2004-03-31 07:25:04.373
2004-03-31 07:27:10.467
2004-03-31 07:27:41.653
2004-03-31 07:28:04.577
2004-03-31 07:29:25.687
2004-03-31 07:29:31.513
2004-03-31 07:29:37.013
2004-03-31 07:31:59.043
2004-03-31 07:32:14.217
2004-03-31 07:33:11.560
2004-03-31 07:33:23.793
2004-03-31 07:33:42.857
2004-03-31 07:33:59.153
2004-03-31 07:34:02.000
2004-03-31 07:34:05.733
2004-03-31 07:34:08.030
2004-03-31 07:34:08.513
2004-03-31 07:35:15.467
2004-03-31 07:35:25.467
2004-03-31 07:35:41.640
2004-03-31 07:36:01.280
2004-03-31 07:36:26.140
2004-03-31 07:36:47.483
2004-03-31 07:37:31.873
2004-03-31 07:37:44.967
2004-03-31 07:37:47.793
2004-03-31 07:38:07.373
2004-03-31 07:38:12.750
2004-03-31 07:38:15.623
2004-03-31 07:38:18.340
2004-03-31 07:38:28.513
2004-03-31 07:38:45.763
2004-03-31 07:39:35.857
2004-03-31 07:40:07.890
2004-03-31 07:40:18.793
2004-03-31 07:40:19.170
2004-03-31 07:40:22.233
2004-03-31 07:40:34.263
2004-03-31 07:40:38.560
2004-03-31 07:41:27.890
2004-03-31 07:41:50.140
2004-03-31 07:41:57.467
2004-03-31 07:42:19.250
2004-03-31 07:42:23.700
2004-03-31 07:42:27.280
2004-03-31 07:42:51.827
2004-03-31 07:43:25.590
2004-03-31 07:43:34.763
2004-03-31 07:44:09.513
2004-03-31 07:44:36.763
2004-03-31 07:45:31.827
2004-03-31 07:45:44.077
2004-03-31 07:46:41.543
2004-03-31 07:46:59.000
2004-03-31 07:47:17.623
2004-03-31 07:47:50.560
2004-03-31 07:48:01.140
2004-03-31 07:48:22.670
2004-03-31 07:49:03.717
2004-03-31 07:49:08.687
2004-03-31 07:50:04.560
2004-03-31 07:50:14.140
2004-03-31 07:51:00.123
2004-03-31 07:51:59.000
2004-03-31 07:52:06.090
2004-03-31 07:53:21.060
2004-03-31 07:53:25.153
2004-03-31 07:53:39.530
2004-03-31 07:54:06.373
2004-03-31 07:54:14.530
2004-03-31 07:54:33.357
2004-03-31 07:54:33.513
2004-03-31 07:54:42.467
2004-03-31 07:54:46.030
2004-03-31 07:55:06.967
2004-03-31 07:55:18.560
2004-03-31 07:55:18.793
2004-03-31 07:55:25.060
2004-03-31 07:56:14.750
2004-03-31 07:56:23.437
2004-03-31 07:56:28.373
2004-03-31 07:56:35.530
2004-03-31 07:56:45.357
2004-03-31 07:56:45.513
2004-03-31 07:57:23.090
2004-03-31 07:57:25.717
2004-03-31 07:57:30.187
2004-03-31 07:57:34.013
2004-03-31 07:57:37.700
2004-03-31 07:57:59.450
2004-03-31 07:58:09.483
2004-03-31 07:58:18.700
2004-03-31 07:58:20.623
2004-03-31 07:58:52.090
2004-03-31 07:58:55.937
2004-03-31 07:59:02.483
2004-03-31 07:59:10.293
2004-03-31 07:59:34.013
2004-03-31 07:59:39.437
2004-03-31 07:59:39.700
2004-03-31 07:59:41.437
2004-03-31 07:59:51.107
2004-03-31 08:00:09.200
2004-03-31 08:00:09.750
2004-03-31 08:00:24.090
2004-03-31 08:01:43.840
2004-03-31 08:02:02.543
2004-03-31 08:02:11.233
2004-03-31 08:02:25.310
2004-03-31 08:02:38.170
2004-03-31 08:03:07.890
2004-03-31 08:03:37.840
2004-03-31 08:03:44.187
2004-03-31 08:04:22.653
2004-03-31 08:04:24.217
2004-03-31 08:04:33.700
2004-03-31 08:04:51.717
2004-03-31 08:04:59.233
2004-03-31 08:05:00.793
2004-03-31 08:05:02.687
2004-03-31 08:05:17.920
2004-03-31 08:05:40.873
2004-03-31 08:06:09.293
2004-03-31 08:06:12.560
2004-03-31 08:06:12.577
2004-03-31 08:06:16.030
2004-03-31 08:06:23.140
2004-03-31 08:06:28.077
2004-03-31 08:06:28.530
2004-03-31 08:06:35.560
2004-03-31 08:06:47.653
2004-03-31 08:07:47.390
2004-03-31 08:07:47.793
2004-03-31 08:07:57.467
2004-03-31 08:07:57.513
2004-03-31 08:07:59.623
2004-03-31 08:08:02.640
2004-03-31 08:08:08.200
2004-03-31 08:08:31.390
2004-03-31 08:08:43.200
2004-03-31 08:09:40.577
2004-03-31 08:09:48.123
2004-03-31 08:09:50.310
2004-03-31 08:09:53.293
2004-03-31 08:10:03.623
2004-03-31 08:10:10.090
2004-03-31 08:10:26.577
2004-03-31 08:10:42.420
2004-03-31 08:10:47.450
2004-03-31 08:10:48.983
2004-03-31 08:11:03.123
2004-03-31 08:11:04.577
2004-03-31 08:11:34.403
2004-03-31 08:12:05.700
2004-03-31 08:12:28.827
2004-03-31 08:12:32.250
2004-03-31 08:12:45.437
2004-03-31 08:13:04.543
2004-03-31 08:13:05.107
2004-03-31 08:13:11.903
2004-03-31 08:13:31.077
2004-03-31 08:13:48.403
2004-03-31 08:13:51.543
2004-03-31 08:13:56.090
2004-03-31 08:14:17.530
2004-03-31 08:14:44.857
2004-03-31 08:15:02.780
2004-03-31 08:15:03.077
2004-03-31 08:15:17.123
2004-03-31 08:15:23.200
2004-03-31 08:16:13.437
2004-03-31 08:16:33.280
2004-03-31 08:16:36.890
2004-03-31 08:17:03.200
2004-03-31 08:17:13.340
2004-03-31 08:17:15.873
2004-03-31 08:17:31.700
2004-03-31 08:17:34.263
2004-03-31 08:18:08.763
2004-03-31 08:18:26.827
2004-03-31 08:18:32.937
2004-03-31 08:18:40.873
2004-03-31 08:18:42.513
2004-03-31 08:18:53.577
2004-03-31 08:19:02.840
2004-03-31 08:19:13.013
2004-03-31 08:19:52.577
2004-03-31 08:19:55.530
2004-03-31 08:20:53.750
2004-03-31 08:21:09.310
2004-03-31 08:21:15.437
2004-03-31 08:21:23.250
2004-03-31 08:22:12.340
2004-03-31 08:22:13.013
2004-03-31 08:22:25.950
2004-03-31 08:22:33.357
2004-03-31 08:23:04.403
2004-03-31 08:23:11.793
2004-03-31 08:23:12.030
2004-03-31 08:23:15.327
2004-03-31 08:23:17.590
2004-03-31 08:23:32.840
2004-03-31 08:23:55.687





derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-06 : 00:44:39
Are you serious?????? Is this the starttime, endtime??? Do you have those as seperate columns? Do you have what users these were? This information is worthless if you don't at least have another column with the endtime, or two more columns to show user and starttime or endtime status.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-07-06 : 00:54:47
quote:
Originally posted by derrickleggett

Are you serious?????? Is this the starttime, endtime??? Do you have those as seperate columns? Do you have what users these were? This information is worthless if you don't at least have another column with the endtime, or two more columns to show user and starttime or endtime status.




That's why he is called the Mean Old DBA


Duane.
Go to Top of Page

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-06 : 00:56:12
well, this is a login history date column for each person. There are no login start time and end time.

I am trying to see how many people were logged in at the same time and what was the maximum number of concurrent users



Go to Top of Page

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-06 : 01:02:25
--better example

Login_id Login_date
1 2004-03-31 08:18:53.577
2 2004-03-31 08:19:02.840
3 2004-03-31 08:19:13.013
4 2004-03-31 08:19:52.577
5 2004-03-31 08:19:55.530
6 2004-03-31 08:20:53.750
7 2004-03-31 08:21:09.310
8 2004-03-31 08:21:15.437
9 2004-03-31 08:21:23.250
10 2004-03-31 08:22:12.340
11 2004-03-31 08:22:13.013
12 2004-03-31 08:22:25.950
13 2004-03-31 08:22:33.357
14 2004-03-31 08:23:04.403
15 2004-03-31 08:23:11.793
16 2004-03-31 08:23:12.030
17 2004-03-31 08:23:15.327
18 2004-03-31 08:23:17.590
19 2004-03-31 08:23:32.840




Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-07-06 : 01:06:01
I still don't understand.
How do you know when the person who logged in at say 2004-03-31 08:21:23.250 Logged off the system?

Without knowing that it is impossible to determine concurrent logins.


Duane.
Go to Top of Page

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-06 : 01:23:19

I should have said that
i need to know how many people were logged in at the same time.

for example

3 people logged in 2004-03-30 13:13:04.763
10 people logged in 2004-03-30 13:13:04.500











Go to Top of Page

scullee
Posting Yak Master

103 Posts

Posted - 2004-07-06 : 01:29:34
select count(end_time) as Logged_in, end_time
from <table_name>
group by end_time

The group by will only work if the times are exact, if you are looking at times for specific minutes or something you will have to reformat the dates.
Go to Top of Page

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-06 : 01:30:30
Do i need to know the log off time to be able to get this result?
I still don't get it why i need a log off time.





Go to Top of Page

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-07-06 : 01:59:33
How do i reformat the datetime if i want to compare for specific minutes ?



Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-06 : 07:56:16
SELECT
COUNT(CONVERT(VARCHAR,end_time,120)) as Logged_in, CONVERT(VARCHAR,end_time,120) AS end_time
from <table_name>
group by CONVERT(VARCHAR,end_time,120)

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

Pat Phelan
Posting Yak Master

187 Posts

Posted - 2004-07-06 : 14:10:36
I think that we're missing a fundamental point here. If the list is login times, and only login times, you can make one of three assumptions. You can assume that the person logged off immediately, in which case there was only 1 simultanteous login because they logged off before anyone else could log on. You can assume that the person never logged off, in which case there were as many simultaneous logins as there were logins (since they would all be simultaneous). You can assume that logins took some finite amount of time, which makes the number of simultaneous logins fall somewhere between zero and the total number of logins.

Without some way to find the duration of each login, we don't have any way to compute the number of simultaneous logins.

-PatP
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-06 : 21:05:15
> How do i reformat the datetime if i want to compare for specific minutes ?

SELECT DATEADD(Minute, DATEDIFF(Minute, 0, Login_date), 0)
Go to Top of Page

derrickleggett
Pointy Haired Yak DBA

4184 Posts

Posted - 2004-07-06 : 23:27:26
I think I tried to explain that pretty hard Pat and gave up.

MeanOldDBA
derrickleggett@hotmail.com

When life gives you a lemon, fire the DBA.
Go to Top of Page

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-07-07 : 00:06:25
Yeah - I divorsed myself from this thread for the same reason.


Duane.
Go to Top of Page

kselvia
Aged Yak Warrior

526 Posts

Posted - 2004-07-07 : 01:52:59
This should give you something useful, although as everyone mentioned, you did not exactly say what you wanted.


--Create a table of numbers to use to calculate intervals. Only run this once. A Numbers table comes in handy
--for verious things anyway.
Create view ZeroToTen AS select 0 ID union select 1 union select 2 union select 3 union
select 4 union select 5 union select 6 union select 7 union select 8 union select 9

SELECT ID = IDENTITY(int, 1, 1)
INTO Numbers
FROM ZeroToTen T1, ZeroToTen T2, ZeroToTen T3, ZeroToTen T4

--Loaded your sample data

CREATE TABLE loginlog (logintime datetime)
BULK INSERT loginlog FROM 'c:\temp\ltimes.txt'

--- This is the script to summarize logins based on time period (seconds) intervals

declare @seconds_interval int
select @seconds_interval = 600 --10 minutes
--select @seconds_interval = 3600 --1 hour

select count(1) LoginCount, ranges.start_interval period from loginlog ,
(
select dateadd(s, ID * @seconds_interval,(select min(logintime) from loginlog)) start_interval ,
dateadd(ss,@seconds_interval - 1, dateadd(s, ID * @seconds_interval,(select min(logintime) from loginlog))) end_interval
from Numbers
where ID < (SELECT datediff(s, min(logintime), max(logintime)) from loginlog)
) ranges
where logintime between ranges.start_interval and ranges.end_interval
group by ranges.start_interval
--order by count(1)
order by ranges.start_interval



--Seconds Interval = 600, order by logins
LoginCount period
----------- ------------------------------------------------------
2 2004-03-31 06:02:55.500
4 2004-03-31 06:12:55.500
7 2004-03-31 08:22:55.500
8 2004-03-31 06:22:55.500
10 2004-03-31 06:42:55.500
12 2004-03-31 06:32:55.500
12 2004-03-31 07:22:55.500
16 2004-03-31 06:52:55.500
18 2004-03-31 07:02:55.500
19 2004-03-30 13:42:55.500
19 2004-03-31 07:42:55.500
21 2004-03-30 13:52:55.500
26 2004-03-31 07:12:55.500
37 2004-03-31 07:32:55.500
39 2004-03-31 08:12:55.500
45 2004-03-31 07:52:55.500
47 2004-03-31 08:02:55.500
49 2004-03-30 14:02:55.500

Change order by or interval to get different results
--Seconds Interval = 3600, order by interval date
LoginCount period
----------- ------------------------------------------------------
2 2004-03-31 05:12:55.500
68 2004-03-31 06:12:55.500
186 2004-03-31 07:12:55.500
46 2004-03-31 08:12:55.500

This may be slow if you have a lot of data and/or poor indexes on your table.
Go to Top of Page
   

- Advertisement -