Troble generating query in with its Dates in Chrnological order

  • Thread starter Thread starter techwiz101
  • Start date Start date
T

techwiz101

I have to create a report by monday, and when I run a quary for monthly
expenses, the months come up in Alphabetical order insted of chrnological
order, and the report generated comes out the same way
 
I have to create a report by monday, and when I run a quary for monthly
expenses, the months come up in Alphabetical order insted of chrnological
order, and the report generated comes out the same way

Correct the error in your query. If you would like help doing so please post
it here in SQL view so we can see it to help you.
 
My first thought is that you are using the Format( ) function, which
generates a STRING value. If you want the months as row headers, then you
can sort by a date or use the Year( ) and Month( ) functions to sort your
data.

If, on the other hand, you are using a crosstab query, and have used the
Format function to group your dates by month, then it will automatically sort
the coumn headers alphabetically unless you force it to do it in some other
order. The correct way to do this is to enter the values in the queries
property sheet in the Column Headings property. This will change the last
line of the SQL query to look something like:

PIVOT Format(DateField,"mmm") In ("Jan","Feb", "Mar", ..., "Dec");

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
Back
Top