query multi tables, count/sum 1 of the tables



I'm quering about 5 tables using inner join. On one of the tables i just
want to count or sum up the results. Here is the example I'm trying to get
working. When I add the SUM(Private.PrivateIDs) I get an error. Is
something like this possible?

SELECT Units.UnitServiceLine, Units.UnitName,
Staffing_Types.StaffingType, Unit_Request.UnitOnDutyStaff,
SUM(Private.PrivateIDs)
FROM Unit_Info
INNER JOIN Unit_Request ON Unit_Info.UIID = Unit_Request.UIID INNER JOIN
Units ON Unit_Info.UnitID = Units.UID
INNER JOIN Staffing_Types ON Unit_Request.STID=Staffing_Types.STID
INNER JOIN Private ON Unit_Info.UIID = Private.UIID

.



Relevant Pages

  • Re: Consolidate rows
    ... in my workaround I used Sum ... instead of DSum, but for some reason I was stuck on DSum in the original ... INNER JOIN ((tblTechPlan ... ProcName PartCat QtySum PartNum ...
    (microsoft.public.access.queries)
  • Re: Crosstab subcolumn query/report heading pblm
    ... Orders INNER JOIN (Products INNER JOIN [Order ... depending on tblReports.ReportType and this mystery ... and sum the count for "RC85" records within ...
    (microsoft.public.access.queries)
  • How can I SUM 3 distinct selects???
    ... and I'm using UNION to agregate all this 3 distincts selects, ... "pontos" fields and show me just one line with the sum result. ... inner join resdistribuidores rd on rd.id = rc.tdistribuidor ...
    (microsoft.public.sqlserver.programming)
  • Multiplying Grouped Columns
    ... I have a query, which selects three columns from an inner join. ... columns are SUM and the first one is GROUP BY. ... Prev by Date: ...
    (microsoft.public.sqlserver.dts)
  • Re: SUM() Taking Too Long
    ... > Here's the plan for the query with the SUM(): ... > SELECT SUM(dbo.AdjustedOrderTotal(tblOrders.ID)) FROM tblOrders ... > INNER JOIN ... > tblPeople ON tblOrders.SoldToContactID = tblPeople.ID WHERE ...
    (microsoft.public.sqlserver.programming)