Solved

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

Posted on 2011-02-25
2
320 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now