sql – Modify the query to group by date

I have this question

select s_Id_Sucursal, s.No_Series, go.Reference, sr.F_Realizacion, p.Id_Product, ds.Quantity, p.Cost * ds.Quantity like TotalGasto
since the internal join of Services c
on s.Id_Sucursal = c.Id_Sucursal and s.Id_Clave_Client = c.Clave_Client inner join servicios_refilled sr
on s.Id_Sucursal = sr.Id_Sucursal and s.Id_Servicio = sr.Id_Service inner join DetailsServices ds
on ds.Id_Sucursal = s.Id_Sucursal and ds.Service_FK = s.Id_Service inner join Product p
on ds.Product_FK = p.Key_Eq_Sisco and ds.Id_Sucursal = p.Id_Sucursal inner join Informa_Rentas ir
on ir.No_Serie = s.No_Serie and ir.Estatus = A & # 39; joined the lines l
on p.Line = l.Id_Linea and p.Id_Sucursal = l.Id_Sucursal
where go.status = & # 39; a & # 39; and s.Id_Service in (select Service_id in Services where No_Serie in (select No_Serie in Informa_Rentas where Status = & # 39; a))
and s.Id_Sucursal = & # 39; CORDOBA & # 39;
order by No_Serie, F_Realization

What generates a result like this:

Serial Number No_Serie Reference F_Realization Product Number Quantity TotalGasto
CORDOBA 07H6BJFB009XV 3228 2018-02-06 00: 00: 00.000 2619 1 10621.96
CORDOBA 07H6BJFB009XV 3228 2018-02-06 00: 00: 00.000 2741 1 291.07
CORDOBA 07H6BJFB009XV 3228 2018-02-06 00: 00: 00.000 2246 1 200.00
CORDOBA 07H6BJFB009XV 3228 2018-03-01 00: 00: 00.000 1219 1 82.32
CORDOBA 07H6BJFB009XV 3228 2018-03-01 00: 00: 00.000 2246 1 200.00
CORDOBA 07H6BJFB009XV 3228 2018-03-08 00: 00: 00.000 1219 1 82.32
CORDOBA 07H6BJFB009XV 3228 2018-04-10 00: 00: 00.000 1219 2 164.64
CORDOBA 07H6BJFB009XV 3228 2018-04-30 00: 00: 00.000 1219 1 82.32
CORDOBA 07H6BJFB009XV 3228 2018-04-30 00: 00: 00.000 2246 1 200.00
CORDOBA 07H6BJFB009XV 3228 2018-06-11 00: 00: 00.000 1219 2 164.64
CORDOBA 07H6BJFB009XV 3228 2018-07-03 00: 00: 00.000 2475 1 250.00

How could I modify the query to group it by No_Serie, Reference, month and add TotalGasto? The TotalGasto sum would also be per month.

The expected result is as follows:

Base_ID No_Series Reference F_Realization TotalGasto
CORDOBA 07H6BJFB009XV 3228 2018-02-06 11113.03
CORDOBA 07H6BJFB009XV 3228 2018-03-01 364.64
CORDOBA 07H6BJFB009XV 3228 2018-04-10 446.96
CORDOBA 07H6BJFB009XV 3228 2018-06-11 164.64
CORDOBA 07H6BJFB009XV 3228 2018-07-03 250.00