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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries does not add up

Status
Not open for further replies.

RGNJ

Technical User
Aug 27, 2004
2
US
I am trying to run the following queries and the total does not sum up correctly, pls. HELP! I am Jr.

Queries required:
Total Unique Employees not using CPU Projects
Total Unique employees using exactly one non-CPU project
Total Unique employees using exactly two non-CPU projects
Total Unique SQL users on non CPU projects
total unique SQL users using exactly one non-CPU project


Project SQL Ver CPU based? Emp ID. Emp Name
ABC MSSQL 2000 ENT NO 123 A
CDE MSSQL 2000 STD YES 123 A
FGH MSSQL 7.0 ENT NO 789 C
ABC MSSQL 2000 ENT YES 102 D
CDE MSSQL 2000 STD YES 789 C
FGH MSSQL 7.0 ENT NO 108 F
IJK MSSQL 7.0 STD YES 110 G


 
Why not posting your sql code ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Note that finding employees on a non-CPU project is not the same as finding employees that have all non-CPU projects.

Try something like this to get everyone's project counts at one time:

Select EmpID, -Sum([CPUBased]) as CPUBased, -Sum(Not [CPUBased]) as NotCPUBased
From YourTable
Group by EmpID


John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top