Hi Anyone - need your help
i would like a query to list two main columns Atime and endtime - query to group the start times and endtime separately - even though the table start out with corresponding start time and end times. table is thousand of lines vary times
Also would like to get say the top times of each Fri Sat Sun of each week in each month over a period of time say 3 months
so for example - first week end in Feb, table would look like below
ATIME EndTIME
2010-02-05 00:03 2010-02-05 00:16
2010-02-05 00:03 2010-02-05 00:16
2010-02-05 00:03 2010-02-06 00:55
2010-02-05 00:03 2010-02-06 00:55
2010-02-06 00:05 2010-02-06 00:55
2010-02-06 00:05 2010-02-06 00:55
2010-02-06 00:05 2010-02-07 00:08
2010-02-07 00:02 2010-02-07 00:08
2010-02-07 00:02 2010-02-07 00:08
query I have only go as far as ( don't care for sec or mili sec )
My columns in table looks like this
ATIME EndTIME
Atime endtime
2010-02-05 00:00:01.000 2010-02-05 00:00:11.000
2010-02-05 00:00:04.000 2010-02-05 01:00:04.000
2010-02-05 00:00:05.000 2010-02-05 00:40:05.000
2010-02-05 00:00:06.000 2010-02-05 02:10:00.000
2010-02-05 00:00:07.000 2010-02-05 00:09:08.000
2010-02-05 00:00:08.000 2010-02-05 00:20:08.000
2010-02-05 00:00:08.000 2010-02-05 00:30:08.000
2010-02-05 00:00:11.000 2010-02-05 00:50:11.000
2010-02-05 00:00:12.000 2010-02-05 01:11:02.000
2010-02-05 00:00:13.000 2010-02-05 00:55:43.000
i would like a query to list two main columns Atime and endtime - query to group the start times and endtime separately - even though the table start out with corresponding start time and end times. table is thousand of lines vary times
Also would like to get say the top times of each Fri Sat Sun of each week in each month over a period of time say 3 months
so for example - first week end in Feb, table would look like below
ATIME EndTIME
2010-02-05 00:03 2010-02-05 00:16
2010-02-05 00:03 2010-02-05 00:16
2010-02-05 00:03 2010-02-06 00:55
2010-02-05 00:03 2010-02-06 00:55
2010-02-06 00:05 2010-02-06 00:55
2010-02-06 00:05 2010-02-06 00:55
2010-02-06 00:05 2010-02-07 00:08
2010-02-07 00:02 2010-02-07 00:08
2010-02-07 00:02 2010-02-07 00:08
query I have only go as far as ( don't care for sec or mili sec )
Code:
select convert(varchar(16)Atime,120) as stime, count(stime),convert(varcher(16)endtime,120) as etime, count(etime) From table Where (ATIME >= '2010-02-01 00:00:00') and (ATIME <= '2010-02-28 23:59:59') and datename(weekday,ATIME) in ( 'Friday','Saturday','Sunday') group by convert(varchar(16)Atime,120), convert(varchar(16)endtime,120)
My columns in table looks like this
ATIME EndTIME
Atime endtime
2010-02-05 00:00:01.000 2010-02-05 00:00:11.000
2010-02-05 00:00:04.000 2010-02-05 01:00:04.000
2010-02-05 00:00:05.000 2010-02-05 00:40:05.000
2010-02-05 00:00:06.000 2010-02-05 02:10:00.000
2010-02-05 00:00:07.000 2010-02-05 00:09:08.000
2010-02-05 00:00:08.000 2010-02-05 00:20:08.000
2010-02-05 00:00:08.000 2010-02-05 00:30:08.000
2010-02-05 00:00:11.000 2010-02-05 00:50:11.000
2010-02-05 00:00:12.000 2010-02-05 01:11:02.000
2010-02-05 00:00:13.000 2010-02-05 00:55:43.000
Comment