Question : Need a SUM

Hey the query is giving me the data for each day but i need it to give me a sum for each day. not a total sum of the date range..

SELECT     FlowLogPeriod.MdbDeviceID, CONVERT(datetime, FlowLogPeriod.LogPeriodFlowDateTime, 101) AS Date, sum(FlowLogPeriod.AP) as AP,
                      DeviceSummary.MeterID
FROM         DeviceSummary INNER JOIN
                      FlowLogPeriod ON DeviceSummary.MdbDeviceID = FlowLogPeriod.MdbDeviceID
WHERE     (DeviceSummary.MeterID IN ('01103-705','01103-706','01103-708')) AND  (FlowLogPeriod.LogPeriodFlowDateTime>= @StartDate) AND (FlowLogPeriod.LogPeriodFlowDateTime -1 <= @EndDate)  AND (DATEPART(HOUR,
                      FlowLogPeriod.LogPeriodFlowDateTime) = 9)

Group by FlowLogPeriod.MdbDeviceID, CONVERT(datetime, FlowLogPeriod.LogPeriodFlowDateTime, 101),
                      DeviceSummary.MeterID

thanks, Sam

Answer : Need a SUM

or maybe you want something like this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
SELECT  	min(FlowLogPeriod.MdbDeviceID),
min(DeviceSummary.MeterID),

cast(CONVERT(varchar, FlowLogPeriod.LogPeriodFlowDateTime, 101)  as datetime) AS Date, 
	 sum(FlowLogPeriod.AP) as AP, 
FROM    DeviceSummary 
INNER JOIN FlowLogPeriod ON DeviceSummary.MdbDeviceID = FlowLogPeriod.MdbDeviceID
WHERE   (DeviceSummary.MeterID IN ('01103-705','01103-706','01103-708')) AND  
(FlowLogPeriod.LogPeriodFlowDateTime>= @StartDate) AND 
 (FlowLogPeriod.LogPeriodFlowDateTime -1 <= @EndDate)  AND 
 (DATEPART(HOUR, FlowLogPeriod.LogPeriodFlowDateTime) = 9) 
Group by cast(CONVERT(varchar, FlowLogPeriod.LogPeriodFlowDateTime, 101) as datetime)
Random Solutions  
 
programming4us programming4us