473,386 Members | 1,943 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,386 software developers and data experts.

MSAccess query barchart color

16
SELECT TrendRemedytbl.[Job Name], Count(*) AS [Count]
FROM TrendRemedytbl
GROUP BY TrendRemedytbl.[Job Name];


This query generates a barchart with jobname in xaxis and counts in yaxis .
Can i also get the color of bar populated CORRECTLY based on if conditions within the query

I want something like what I have pasted below but the syntax is incorrect. Please help ...


SELECT iif TrendRemedytbl.[Job Name] = "A" THEN TrendRemedytbl.[Job Name] AS RED,iif TrendRemedytbl.[Job Name] = "B" THEN TrendRemedytbl.[Job Name] AS BLUE,iif TrendRemedytbl.[Job Name] = "C" THEN TrendRemedytbl.[Job Name] AS GREEN, Count(*) AS [Count]
FROM TrendRemedytbl
GROUP BY TrendRemedytbl.[Job Name];
Nov 15 '11 #1

✓ answered by dsatino

I think you want this:
Expand|Select|Wrap|Line Numbers
  1. SELECT Switch(TrendRemedytbl.[Job Name] = "A","Red",TrendRemedytbl.[Job Name] = "B","Blue",TrendRemedytbl.[Job Name] = "C","Green") As Job,Count(*) AS [Count]
  2. FROM TrendRemedytbl
  3. GROUP BY Switch(TrendRemedytbl.[Job Name] = "A","Red",TrendRemedytbl.[Job Name] = "B","Blue",TrendRemedytbl.[Job Name] = "C","Green")
  4.  

1 1474
dsatino
393 256MB
I think you want this:
Expand|Select|Wrap|Line Numbers
  1. SELECT Switch(TrendRemedytbl.[Job Name] = "A","Red",TrendRemedytbl.[Job Name] = "B","Blue",TrendRemedytbl.[Job Name] = "C","Green") As Job,Count(*) AS [Count]
  2. FROM TrendRemedytbl
  3. GROUP BY Switch(TrendRemedytbl.[Job Name] = "A","Red",TrendRemedytbl.[Job Name] = "B","Blue",TrendRemedytbl.[Job Name] = "C","Green")
  4.  
Nov 15 '11 #2

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

Similar topics

1
by: Bhavin | last post by:
How can I check NTFS permission and how to give the IUSR account sufficient privileges to update the database which is in MSACCESS. It's always give error operation must use updatable query....
15
by: (Pete Cresswell) | last post by:
I've got a .BAT file that I use for executing various MS Access apps that I wrote way back in the days of 2.0. It's evolved over time, but it still contains a number of possible paths to...
3
by: Pedro Maria Ferro da Cunha | last post by:
I spend a lot of time making 2 thousand pictures and saving them as an article name. jpg. I have a table with the article name and name of the file in jpg (format). How can I make an...
0
by: g_sharad | last post by:
hi friends I am facing problems generating a query from access database. I have a form which fills all the records, validates and then send the collected info to the db. Now the problem part,...
15
by: rlayberry | last post by:
Hi I have found what looks like a huge bug in MSAccess. When I have the following in a table in Access 1996 0.08715292
0
by: contiw | last post by:
With ColdFusion and MSAccess 2003, the folowing query : SELECT A.*, B.entry_id FROM A.blog_entries, B.blog_subscriptions WHERE B.blog_id = #variables.blog_id# AND B.user_id =...
1
by: syampjt011170 | last post by:
I need help to solve my problem's cummulative calculation. here, i have table's data input : station time rh mlg 03/01/07 01:00 2 mlg 03/01/07...
7
cori25
by: cori25 | last post by:
I have data that I want to import from access into excel, I need to be able to pull in the data so that it can be automated to appear in calendar format. The dates are in the db, so I want it to be...
1
by: eogyamfi | last post by:
I have field called Datoutkd in my table, I need this field to rename date in the query. I used the replace function in order to create a new column with date as the field but could not work. ...
5
by: slickdock | last post by:
I need to break my query into 3 groups: First 60 records (records 1-60) Next 60 records (records 61-121) Next 60 records (records 122-182) Of course I could use top values 60 for the first...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.