Hi,
I’m trying to sum some values only if the month is january, but when I try to run, scriptcase is stuck. This is my SQL statment
SELECT
RV2_Fecha,
RV2_Cliente,
RV2_Actividad,
SUM(IF (MONTH(’{RV2_Fecha}’) = 1, RV2_PAX, 0)) as Ene_PAX,
SUM(IF (MONTH(’{RV2_Fecha}’) = 1, RV2_Importe + RV2_Transporte + RV2_LunchDin + RV2_ActExtra, 0)) as Ene_TotVta,
SUM(IF (MONTH(’{RV2_Fecha}’) = 1, RV2_Deposito + RV2_Comision, 0)) as Ene_TotCom,
RV2_Cancelado,
RV2_Pagado
FROM
RV2_Reserv2
WHERE RV2_Cancelado <> ‘1’ AND RV2_Pagado = ‘1’
GROUP BY RV2_Cliente, RV2_Actividad
Regards
Gerardo