473,385 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Fill in missing data on a graph in Access 97

2
MS Access 97
WinXP

I've created a report bar graph and each bar represents the data from a different BU(Business Unit). The report bar graph works as it should except for the following : depending on the reporting dates selected there are some BU where there is no data, so that BU is skipped on the graph. How can I get the BU without data to appear on the chart (basicaly I need the BU unit to appear on the X axis with a value of 0) ?

Here is the SQL behind it :

Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_SABU.SABU_Desc, tbl_SA.SA_Ergo
  2. FROM (tbl_SA INNER JOIN tbl_SABU ON tbl_SA.SABU_ID_FK = tbl_SABU.SABU_ID) INNER JOIN tbl_TA ON tbl_SA.SA_Ergo = tbl_TA.SA_ERGO_FK
  3. WHERE (((tbl_TA.TA_CloseDT) Between [forms].[frm_rprt].[txtStartDate] And [forms].[frm_rprt].[txtEndDate]))
  4. GROUP BY tbl_SABU.SABU_Desc, tbl_SA.SA_Ergo;
Mar 5 '08 #1
2 1879
Stewart Ross
2,545 Expert Mod 2GB
MS Access 97
WinXP

I've created a report bar graph and each bar represents the data from a different BU(Business Unit). The report bar graph works as it should except for the following : depending on the reporting dates selected there are some BU where there is no data, so that BU is skipped on the graph. How can I get the BU without data to appear on the chart (basicaly I need the BU unit to appear on the X axis with a value of 0) ?

Here is the SQL behind it :

SELECT tbl_SABU.SABU_Desc, tbl_SA.SA_Ergo
FROM (tbl_SA INNER JOIN tbl_SABU ON tbl_SA.SABU_ID_FK = tbl_SABU.SABU_ID) INNER JOIN tbl_TA ON tbl_SA.SA_Ergo = tbl_TA.SA_ERGO_FK
WHERE (((tbl_TA.TA_CloseDT) Between [forms].[frm_rprt].[txtStartDate] And [forms].[frm_rprt].[txtEndDate]))
GROUP BY tbl_SABU.SABU_Desc, tbl_SA.SA_Ergo;
Hi. Keep your chart query as listed above. Create a new query which left joins your business units table to this chart query and use it to create your chart instead of the original one. The left join is what will allow you to show all business units.

Sample SQL is listed below, but you will need to change the chart query name placeholder to its actual name:
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_SABU.SABU_Desc, Nz(YourChartQuery.SA_Ergo, 0) as ChartValue
  2. FROM tbl_SABU LEFT JOIN YourChartQuery ON tbl_SABU.SABU_ID = YourChartQuery.SABU_ID
  3. GROUP BY tbl_SABU.SABU_Desc, ChartValue;
Where there is no data to plot there will be a null for the selected value field from your chart query, hence the use of Nz to substitute a 0 instead.

Hope this helps.

-Stewart
Mar 8 '08 #2
Sirrev
2
Thank you very much for your help, from your example our Chart now shows exactly the required values.
Again greatly appreciate your help !
Mar 14 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jeff Blee | last post by:
I am hoping someone can help me. I am making a Access 97 app for a person and have run up against a problem to do with MS Graph. There is a table that has a number of data elements and a date field...
2
by: MLH | last post by:
This question, I apologize, is more of a math question than it is an Access question - I'm almost certain. The bell curve is another name for the normal distribution, which is a common type of...
4
by: Sherwood Botsford | last post by:
Table Markers ID (Primary Key) This&That PointClass (Combo box) Points Table PointClasses PointClass (primary key) Points (number) Description (Text)
6
by: JeffB | last post by:
I have tried several different methods of getting a datagrid to fill with information. Below is the code I'm now using. When viewed in the browser and the text box filled with a parameter value...
12
by: Nathan Harmston | last post by:
Hi All, Currently I am working on a generic graph library so I can do various graph based analysis for various projects I have ideas for. Currently I am implementing Graph as a wrapper around a...
1
by: Herbert Chan | last post by:
Hello, I'm subscribing to funds on HSBC, and the fund prices can be found here: http://www.tools.hsbc.com.hk/search/mpf?id=hk+mpf+fundsearch&lang=en&init=true At the moment, I'm copying each...
2
by: colin | last post by:
Hi, Im tidying up some code ive written wich atm is all in the main form. its working reasonably well, uses zedgraph wich is nice, but i need to tidy it up as its become increasingly difficult...
5
by: grant | last post by:
I'm trying to use a scatter chart to plot level reading for a pump station level sensor. The sensor takes a reading every 4 seconds, and there are 23,000 reading per chart There appears to be...
1
rwbarrette
by: rwbarrette | last post by:
Hi all, I just joined 'the scripts' after a year of using it as a great resource, mostly for Python. However, I've been beating my head in for a while now trying to find a solution for a problem...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.