order on the months

  • Thread starter Thread starter Rodolfo Fontes
  • Start date Start date
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
 
At least one reply in another NG where you asked the same question. Please
don't post to multiple NGs. Keep in mind that the order in the query does
not set the order in the report.
 
As my doubt was about querie and the report, i've put them on the two NGs.
Sorry for anything.

Rodolfo Fontes

Duane Hookom said:
At least one reply in another NG where you asked the same question. Please
don't post to multiple NGs. Keep in mind that the order in the query does
not set the order in the report.

--
Duane Hookom
MS Access MVP
--

Rodolfo Fontes said:
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
 
You can post the same question to multiple groups at the same time rather
than posting twice. This places replies in both NGs simultaneously.

--
Duane Hookom
MS Access MVP
--

Rodolfo Fontes said:
As my doubt was about querie and the report, i've put them on the two NGs.
Sorry for anything.

Rodolfo Fontes

Duane Hookom said:
At least one reply in another NG where you asked the same question.
Please
don't post to multiple NGs. Keep in mind that the order in the query does
not set the order in the report.

--
Duane Hookom
MS Access MVP
--

Rodolfo Fontes said:
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
 
Back
Top