order on the months

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
 
D

Duane Hookom

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.
 
R

Rodolfo Fontes

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
 
D

Duane Hookom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top