SQL Server 2008 Group by 30 minute Time Intervals I have a SQL select statement which produces the following results, and I need to define it so that we can group the data based on 30 minute intervals of time and provide the sum of Revenue and Nbr of Trans.

Table Date/Time field -

ActionDateTime          REVENUE NBR of TRANS
2013-01-03 07:44:57.840 5.00    1
2013-01-03 07:45:10.093 5.00    1
2013-01-03 07:45:21.557 1.00    1
2013-01-03 09:07:21.253 50.00   1
2013-01-03 09:07:42.680 40.00   1
2013-01-03 09:07:49.007 104.30  1


Current Results -

DATE        TIME             REVENUE    NBR of TRANS
01/03/2013   07:44:57   5.00    1
01/03/2013   07:45:10   5.00    1
01/03/2013   07:45:21   1.00    1
01/03/2013   09:07:21   50.00   1
01/03/2013   09:07:42   40.00   1
01/03/2013   09:07:49   104.30  1


Desired Results -

DATE        TIME             REVENUE    NBR of TRANS
01/03/2013   08:00:00    11.00  3
01/03/2013   09:30:00   194.30  3


Current SQL statement -

select
  'DATE' = CONVERT(VARCHAR(12), x30.ActionDateTime, 101), 
  'TIME' = CONVERT(VARCHAR(12), x30.ActionDateTime, 108), 
  'REVENUE' = SUM(t01.Amount), 
  'NBR of TRANS' = COUNT(t01.DocumentNumber)
from
dbo.X30_AuditInformation x30 with (nolock),
dbo.T01_TransactionMaster t01 with (nolock),
dbo.T04_GiftDetails t04 with (nolock),
dbo.B01_BatchMaster b01 with (nolock)
where x30.TableRecordId = t01.RecordId and x30.TableId = 'T01_' and x30.Action = 'INSERT'
and t01.DocumentNumber = t04.DocumentNumber 
and b01.BatchNumber = t01.BatchNumber 
and t01.Date between '01/01/2013' and '01/02/2013'
and b01.BatchCategory in ('IMC')
and t04.SourceCode like 'T%'
GROUP BY x30.ActionDateTime, DATEPART(MINUTE, x30.ActionDateTime)/30 
ORDER BY x30.ActionDateTime


Is my GROUP BY incorrect?
Just this...

SELECT
    'DATE' = CONVERT(VARCHAR(12), CAST(x30.ActionDateTime AS date), 101),
    'TIME' = CAST(DATEPART(HOUR, x30.ActionDateTime) AS char(2)) + ':' + CAST(DATEPART(MINUTE, x30.ActionDateTime)/30 AS char(2),
    ...

GROUP BY
    CAST(x30.ActionDateTime AS date),
    DATEPART(HOUR, x30.ActionDateTime),
    DATEPART(MINUTE, x30.ActionDateTime)/30