Solved

Modifying a chart in Access (Changing X axis formatting from SQL statement)

Posted on 2011-02-25
2
324 Views
Last Modified: 2013-06-19
Hello, I have a chart which is being generated by the following SQL code:

Query:
SELECT Imported.[Modified By], Count(1) AS UserCount, (Select Count (*) from Imported) AS TotCount, Round([Usercount]*100/[TotCount],2) AS Userpercent, Sum(IIf([Date Modified]=Date()-14,1,0)) AS Day14, Sum(IIf([Date Modified]=Date()-13,1,0)) AS Day13, Sum(IIf([Date Modified]=Date()-12,1,0)) AS Day12, Sum(IIf([Date Modified]=Date()-11,1,0)) AS Day11, Sum(IIf([Date Modified]=Date()-10,1,0)) AS Day10, Sum(IIf([Date Modified]=Date()-9,1,0)) AS Day9, Sum(IIf([Date Modified]=Date()-8,1,0)) AS Day8, Sum(IIf([Date Modified]=Date()-7,1,0)) AS Day7, Sum(IIf([Date Modified]=Date()-6,1,0)) AS Day6, Sum(IIf([Date Modified]=Date()-5,1,0)) AS Day5, Sum(IIf([Date Modified]=Date()-4,1,0)) AS Day4, Sum(IIf([Date Modified]=Date()-3,1,0)) AS Day3, Sum(IIf([Date Modified]=Date()-2,1,0)) AS Day2, Sum(IIf([Date Modified]=Date()-1,1,0)) AS Day1, Sum(IIf([Date Modified]=Date(),1,0)) AS Day0, Sum(IIf([Date Modified]>Date()-7,1,0)) AS Last7Days, Sum(IIf([Date Modified]>Date()-30,1,0)) AS Last30Days
FROM Imported
WHERE (((Imported.[Modified By]) Is Not Null))
GROUP BY Imported.[Modified By];

VBA:
Private Sub Form_Load()
Dim strSQL As String
strSQL = "SELECT qryAudit.[Modified By], "
strSQL = strSQL & "Sum(qryAudit.Day14) AS " & Format(DateAdd("d", -14, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day13) AS " & Format(DateAdd("d", -13, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day12) AS " & Format(DateAdd("d", -12, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day11) AS " & Format(DateAdd("d", -11, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day10) AS " & Format(DateAdd("d", -10, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day9) AS " & Format(DateAdd("d", -9, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day8) AS " & Format(DateAdd("d", -8, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day7) AS " & Format(DateAdd("d", -7, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day6) AS " & Format(DateAdd("d", -6, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day5) AS " & Format(DateAdd("d", -5, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day4) AS " & Format(DateAdd("d", -4, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day3) AS " & Format(DateAdd("d", -3, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day2) AS " & Format(DateAdd("d", -2, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day1) AS " & Format(DateAdd("d", -1, Date), "\[m\/d\/yy\]") & ", "
strSQL = strSQL & "Sum(qryAudit.Day0) AS " & Format(DateAdd("d", -0, Date), "\[m\/d\/yy\]") & " "
strSQL = strSQL & "FROM qryAudit GROUP BY qryAudit.[Modified By];"
Me.Graph1.RowSource = strSQL
Me.Graph1.Requery
End Sub


However, when I generate the graph it is presented as seen in the attached image example.  I would like the formatting to be similar to that of the image 'ee example-2.jpg'.  How would I change the code so that results are displayed with the user data on the same day side by side, and change the X axis to the date with the legend reflecting user (currently the legend will display the dates).  Sorry if this is a simple matter, but I think these Access graphs are somewhat difficult to work with considering the alternatives.

Ryan
ee-example.JPG
EE-example-2.JPG
0
Comment
Question by:Bevos
2 Comments
 

Accepted Solution

by:
Bevos earned 0 total points
ID: 34982935
Fixed this one myself again. Guess its one of those kinda days on the E-E.
0
 
LVL 3

Expert Comment

by:IndiaRahul
ID: 39258683
Hi Bevos,

I am looking for the answer to same question. How to format x-axis from number to percentage and vice-versa (Access Pivot-chart)?

would be great if you can help me reach a solution.

Thanks Rahul
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
unable to save new report from old one 9 28
Reference theme colors in VBA 4 24
Any Way to Print an Import Spec? 3 29
Access on Mouse move 5 30
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question