I
Ivan R via AccessMonster.com
I have a query that obtains the username(detective) and calculates totals.
The query works great, however it does not identify all detectives. It only
lists detectives that have any record of action for example.
Main
Detective Felony Misdemeanor Felony Misdemeanor Search K T1
Consensua Property
Barnum 0 1 0 0 0 0 0 0
Thomas 0 0 0 0 0 0 0 0
Williams 0 0 0 1 0 0 0 0
However there are two mor detectives that don't have this type of cases. I
would like for them to appear on the query results as well, with all zeros.
Is this possible?
My sql code is as follows
SELECT Main.Detective, nz(([Felony_Arrest]),0) AS [Feloney Arrest], nz((
[Misdemeanor_Arrest]),0) AS [Misdemeanor Arrests], nz(([Felony_Warrant]),0)
AS [Felony Warrant], nz(([Misdemeanor_Warrant]),0) AS [Misdemeanor Warrants],
nz(([Search_Warrant]),0) AS [Search Warrants], nz(([K_T1]),0) AS [K T1], nz((
[Consensual_Search]),0) AS [Consensual Searches], nz(([Property_Confiscated]),
0) AS [Property Confiscated]
FROM Main INNER JOIN Criminal ON Main.SafeCaseID = Criminal.SafeCaseID;
Any help would be appreciated
The query works great, however it does not identify all detectives. It only
lists detectives that have any record of action for example.
Main
Detective Felony Misdemeanor Felony Misdemeanor Search K T1
Consensua Property
Barnum 0 1 0 0 0 0 0 0
Thomas 0 0 0 0 0 0 0 0
Williams 0 0 0 1 0 0 0 0
However there are two mor detectives that don't have this type of cases. I
would like for them to appear on the query results as well, with all zeros.
Is this possible?
My sql code is as follows
SELECT Main.Detective, nz(([Felony_Arrest]),0) AS [Feloney Arrest], nz((
[Misdemeanor_Arrest]),0) AS [Misdemeanor Arrests], nz(([Felony_Warrant]),0)
AS [Felony Warrant], nz(([Misdemeanor_Warrant]),0) AS [Misdemeanor Warrants],
nz(([Search_Warrant]),0) AS [Search Warrants], nz(([K_T1]),0) AS [K T1], nz((
[Consensual_Search]),0) AS [Consensual Searches], nz(([Property_Confiscated]),
0) AS [Property Confiscated]
FROM Main INNER JOIN Criminal ON Main.SafeCaseID = Criminal.SafeCaseID;
Any help would be appreciated