Troble generating query in with its Dates in Chrnological order

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
 
J

John W. Vinson

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

Dale Fye

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.
 

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