M
Menhir
Hello,
I am pretty new to Access and mostly self-taught by trial and error in the
last couple of weeks. You can imagine the number of faux pas I am probably
committing in terms of Access best user practices. Anyway, to set things up...
Database Details:
1. I have one big table called 'CIM Customer Table' that has a lot of fields
and records including fields named 'Group', 'Region', and 'Status' among
other fields.
2. I have 3 Groups with 4 Regions under each
3. I am looking to get a count of all the records with a Status of
'Scheduled' for each of these 12 regions.
4. My problem is that there are some regions that do not have this status at
all
5. Access of course does not show a zero count if there is no record with
'Scheduled'.
Attempted Resolutions:
1. I have looked through a lot of posts and tried the Nz function, IsNull
function, and the outer join function (which I realize requires two tables)
but to no avail.
2. Here is the SQL code that I started with (which is clearly wrong)
SELECT [cim customer table].[Group], [cim customer table].[Region],
Count([cim customer table].Status) AS ['Pharmacies Scheduled']
FROM [cim customer table]
WHERE [cim customer table].Status='Scheduled'
GROUP BY [cim customer table].Group, [cim customer table].Region;
3. The results comes out to be like this:
Group Region Pharmacies Scheduled
Central Great Lakes 3
Central Pacific North 4
East New England 2
East Northeast 1
East Ohio Valley 3
4. I need it to show:
Central Great Lakes 3
Central Mid-America 0
Central Pacific North 4
Central Pacific Southern 0
East New England 2
East Northeast 1
East Ohio Valley 3
East Atlantic 0
Southeast Gulf 0
Southeast Southern 0
Southeast Southwest 0
Please Help! I am sure this is pretty easy, but it's tough to figure it out
if you have absolutely no clue where to go once you're at a deadend.
Thanks so much in advance!
I am pretty new to Access and mostly self-taught by trial and error in the
last couple of weeks. You can imagine the number of faux pas I am probably
committing in terms of Access best user practices. Anyway, to set things up...
Database Details:
1. I have one big table called 'CIM Customer Table' that has a lot of fields
and records including fields named 'Group', 'Region', and 'Status' among
other fields.
2. I have 3 Groups with 4 Regions under each
3. I am looking to get a count of all the records with a Status of
'Scheduled' for each of these 12 regions.
4. My problem is that there are some regions that do not have this status at
all
5. Access of course does not show a zero count if there is no record with
'Scheduled'.
Attempted Resolutions:
1. I have looked through a lot of posts and tried the Nz function, IsNull
function, and the outer join function (which I realize requires two tables)
but to no avail.
2. Here is the SQL code that I started with (which is clearly wrong)
SELECT [cim customer table].[Group], [cim customer table].[Region],
Count([cim customer table].Status) AS ['Pharmacies Scheduled']
FROM [cim customer table]
WHERE [cim customer table].Status='Scheduled'
GROUP BY [cim customer table].Group, [cim customer table].Region;
3. The results comes out to be like this:
Group Region Pharmacies Scheduled
Central Great Lakes 3
Central Pacific North 4
East New England 2
East Northeast 1
East Ohio Valley 3
4. I need it to show:
Central Great Lakes 3
Central Mid-America 0
Central Pacific North 4
Central Pacific Southern 0
East New England 2
East Northeast 1
East Ohio Valley 3
East Atlantic 0
Southeast Gulf 0
Southeast Southern 0
Southeast Southwest 0
Please Help! I am sure this is pretty easy, but it's tough to figure it out
if you have absolutely no clue where to go once you're at a deadend.
Thanks so much in advance!