R
Rodolfo Fontes
Hi group,
I've done a query to list all events, grouping by the month.
By this query, i've used the format() command to transform the date on
month.
After that, i've done another query to group the months.
And fnally, i've put then on a graph.
The trouble is, if i put the months in order on the graph, it will follow
the order, a... b.. c....
But I wanna follow Jan... Fev....March... and so.
Any ideas?
The SQL code from the first querie
SELECT Format([data],"mmmm") AS Mes, Count([T Eventos].DescrEvento) AS
Evento
FROM [T Eventos] INNER JOIN [T Ocorrencias] ON [T Eventos].CodEvento = [T
Ocorrencias].CodEvento
GROUP BY Format([data],"mmmm"), [T Ocorrencias].Data, [T
Ocorrencias].CodEvento
HAVING ((([T Ocorrencias].Data)>=nz([Formulários]![F
Relatorio_Completo]![txtData_I]) And ([T
Ocorrencias].Data)<=nz([Formulários]![F Relatorio_Completo]![txtData_F]))
AND (([T Ocorrencias].CodEvento)=[Formulários]![F
Relatorio_Completo]![cmbOcorrencia])) OR ((([Formulários]![F
Relatorio_Completo]![cmbOcorrencia]) Is Null));
The SQL code from the second querie
SELECT [C QtdOcorrenciasMesC].Mes, Count([C QtdOcorrenciasMesC].Evento) AS
Evento
FROM [C QtdOcorrenciasMesC]
GROUP BY [C QtdOcorrenciasMesC].Mes
ORDER BY [C QtdOcorrenciasMesC].Mes;
Thanks,
Rodolfo Fontes
I've done a query to list all events, grouping by the month.
By this query, i've used the format() command to transform the date on
month.
After that, i've done another query to group the months.
And fnally, i've put then on a graph.
The trouble is, if i put the months in order on the graph, it will follow
the order, a... b.. c....
But I wanna follow Jan... Fev....March... and so.
Any ideas?
The SQL code from the first querie
SELECT Format([data],"mmmm") AS Mes, Count([T Eventos].DescrEvento) AS
Evento
FROM [T Eventos] INNER JOIN [T Ocorrencias] ON [T Eventos].CodEvento = [T
Ocorrencias].CodEvento
GROUP BY Format([data],"mmmm"), [T Ocorrencias].Data, [T
Ocorrencias].CodEvento
HAVING ((([T Ocorrencias].Data)>=nz([Formulários]![F
Relatorio_Completo]![txtData_I]) And ([T
Ocorrencias].Data)<=nz([Formulários]![F Relatorio_Completo]![txtData_F]))
AND (([T Ocorrencias].CodEvento)=[Formulários]![F
Relatorio_Completo]![cmbOcorrencia])) OR ((([Formulários]![F
Relatorio_Completo]![cmbOcorrencia]) Is Null));
The SQL code from the second querie
SELECT [C QtdOcorrenciasMesC].Mes, Count([C QtdOcorrenciasMesC].Evento) AS
Evento
FROM [C QtdOcorrenciasMesC]
GROUP BY [C QtdOcorrenciasMesC].Mes
ORDER BY [C QtdOcorrenciasMesC].Mes;
Thanks,
Rodolfo Fontes