Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to total the A and Rs' seperately from the accept column 1

Status
Not open for further replies.

jvic

Technical User
Joined
Aug 1, 2008
Messages
3
Location
US
TRANSFORM Count(dbo_Welders.active_flag) AS CountOfactive_flag
SELECT dbo_Welders.stencil_id, dbo_Welders.fullname
FROM dbo_Welders RIGHT JOIN dbo_WL ON dbo_Welders.wl_row_id = dbo_WL.row_id
WHERE (((dbo_Welders.accept) In ('A','R')))
GROUP BY dbo_Welders.stencil_id, dbo_Welders.fullname
ORDER BY dbo_Welders.accept
PIVOT dbo_Welders.accept;
I am trying to count the As' and Rs'and total for each row.
I have a problem getting the values of either column to populate if one is null
 

Why not:
Code:
SELECT Accept, COUNT(*) FROM dbo_Welders
GROUP BY Accept

will return (assuming that A and R are the only values in ACCEPT...if there are others, they will get counted too!, belows shows A R and null (or blank)):
[tt]
Accept Expr1
A 15
R 12
8
[/tt]


Leslie

Have you met Hardy Heron?
 
What about this ?
Code:
TRANSFORM Count(*) AS CountOfactive_flag
SELECT dbo_Welders.stencil_id, dbo_Welders.fullname
FROM dbo_Welders RIGHT JOIN dbo_WL ON dbo_Welders.wl_row_id = dbo_WL.row_id
WHERE Nz(dbo_Welders.accept,' ') In (' ','A','R')
GROUP BY dbo_Welders.stencil_id, dbo_Welders.fullname
ORDER BY dbo_Welders.accept
PIVOT dbo_Welders.accept;

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top