PDA

View Full Version : Month query / View


sotiris_s
May 25th, 2004, 09:21 AM
I have a table that have a field that holds dates and i have name it as "Mera" , now i want to make a query to
show me the products from that table in a year but in month segments i wrote in a query field the follow :
Month: Year([Mera]) & "-" & Month([Mera]) {and also group by, and asceding}
everything works fine but! when i go and make a chart out of this the data is there but the thysical order of the
months is gone... is something like 2004-1,2004-10,2004-11,2004-12,2004-2,2004-3 etc
is there something so i can corectly sort the data?
It is so important to me
Thank you for your time to help me,
Sotiris Stroungaris

Nikos Yannacopoulos
May 25th, 2004, 10:47 AM
Sotiri,

This is happening because the expression Year([Mera]) & "-" & Month([Mera])
returns a text, so it is sorted as such. Try something like:

Format([Mera],"yyyy-mm"

instead. This will retain the date/time type of the original field, so your
sorting will be correct.

HTH,
Nikos

"sotiris_s" > wrote in message
...
> I have a table that have a field that holds dates and i have name it as
"Mera" , now i want to make a query to
> show me the products from that table in a year but in month segments i
wrote in a query field the follow :
> Month: Year([Mera]) & "-" & Month([Mera]) {and also group by, and
asceding}
> everything works fine but! when i go and make a chart out of this the data
is there but the thysical order of the
> months is gone... is something like
2004-1,2004-10,2004-11,2004-12,2004-2,2004-3 etc
> is there something so i can corectly sort the data?
> It is so important to me
> Thank you for your time to help me,
> Sotiris Stroungaris

Google