I’ve built this query to give me a list of how much IMPORTE each COD_ZONA has done in the current month. The date is indicated by FECHA_EMIS and COD_CLIENT is the link between the two tables.
SELECT GVA12.FECHA_EMIS, GVA12.IMPORTE, GVA14.COD_ZONA
FROM GVA12 INNER JOIN GVA14 ON GVA12.COD_CLIENT = GVA14.COD_CLIENT
GROUP BY GVA12.FECHA_EMIS, GVA12.IMPORTE, GVA14.COD_ZONA
HAVING (((GVA12.FECHA_EMIS)=Month(curDate())));
It gives an empty table.
@bluefeet this is how I would like the final table
COD_ZONA IMPORTE
1 1457.56
16 127.45
It sounds like you need to use this, apply the
Month()function to both theGVA12.FECHA_EMISand thecurDate():If you want to compare both month and year, then I would use:
This would make sure that the month and year are equal.
If you want a
sum()then you would use: