Question: I built the following query using ms access.

```
SELECT GVA14.COD_VENDED, Count(GVA14.RAZON_SOCI) AS CountOfRAZON_SOCI
FROM GVA14
GROUP BY GVA14.COD_VENDED, Year([FECHA_ALTA]), Month([FECHA_ALTA])
HAVING (((Year([FECHA_ALTA]))=Year(curDate())) AND
        ((Month([FECHA_ALTA]))=Month(curDate())));

```

The error is

> 
> [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[FECHA\_ALTA]), Month([FECHA\_ALTA]) 
> 
> 
> 

I changed the "date" to "curdate" to comply with MySQL but it still comes up with an error.

Answer: 
Fixed with this query from Leandro Barreto

```
SELECT GVA14.COD_VENDED, GVA14.RAZON_SOCI, GVA14.FECHA_ALTA
FROM GVA14
WHERE Month(GVA14.FECHA_ALTA)=Month(curDate())
and Year(GVA14.FECHA_ALTA)=Year(curDate())
GROUP BY GVA14.COD_VENDED, GVA14.RAZON_SOCI, GVA14.FECHA_ALTA

```
Error in your syntax here `Year(curDate()))` . Please change this to `Year(curDate())` to solve this .

Query :

```
   SELECT GVA14.COD_VENDED, Count(GVA14.RAZON_SOCI) AS CountOfRAZON_SOCI
FROM GVA14
GROUP BY GVA14.COD_VENDED, Year([FECHA_ALTA]), Month([FECHA_ALTA])
HAVING (((Year([FECHA_ALTA]))=Year(curDate()) AND ((Month([FECHA_ALTA]))=Month(curDate())));

```