Month query / View

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 th
months is gone... is something like 2004-1,2004-10,2004-11,2004-12,2004-2,2004-3 et
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
 
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 said:
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
 
Back
Top