Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries on graphs

Status
Not open for further replies.

Radman

Programmer
Jan 20, 2000
22
AU
I have written a query to represent data on a graph. The X axis of the represent all months of the year which come from th query. The way that the months are shown is by number i,e 1,2 3 etc <br>
What i want is for the months to be shown as Jan , Feb , Mar etc.<br>
I am only using a select Query.<br>
I sort the dates by using Month(Date). Thats what produces the numbers.<br>
To produce the Names for the dates i have tried to Format(date,'mmm') in (&quot;Jan&quot;, &quot;feb&quot; etc). Do i have to do this is a crosstab query?<br>
Can u use a crosstab query for a graph? <br>
Can you show me a way to hard code the x axis columns for the chart?<br>
Is the only way to change this is by changing my datetime fields in the tables so that the dates come out this way?<br>
Do i have to live with the numbers?<br>

 
It is not necessary to use a crosstab query. However, there are many times when a crosstab is the only way to represent your data correctly in a chart. There are ways to hard code but they can create their own set of problems. You do not have to live with the numbers. There is always a resolution to any difficulties you may have with Access the trick is just finding the solution without pulling your hair out. Try this out and if you still have trouble send me a copy of your database (small with sample data only) and designate the queries and graphs you are using. Send it to <A HREF="mailto:michaelj1@home.com">michaelj1@home.com</A>.<br>
<br>
Expr1: (Format([Report Date],&quot;mmm&quot;&quot; '&quot;&quot;yy&quot;))<br>
<br>
Use this expression in the first column in your query grid and it will format the date field you are using to the following format; Jan '99. Substitute your date field for Report Date. <br>
<br>
(Year([Report Date])*12+Month([Report Date])-1)<br>
<br>
Use this in the last column and uncheck the show box to hide this field, but be sure to select &quot;Ascending&quot; order in the sort box, and use grouping for the query and select &quot;Group By&quot; in the totals box for both of the expressions. This will sort the months in the correct order vs alpha with the formatting change.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top