View Single Post
  #1 (permalink)  
Old April 23rd, 2018, 02:09 PM
eel3720 eel3720 is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2018
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Distinct count sub query problem

Hello, I have a problem where my table tblskid has the following data:

ID, Code, Name, EQUIP
1, 920, Clinton, Jacob, Motor pool
1, 920, Clinton, Jacob, Motor pool
1, 920, Clinton, Jacob, Motor pool
1, 920, Clinton, Jacob, Motor pool


I need the distinct count(EQUIP) TO be 1 see below:

SELECT DISTINCT Count(tblskid.EQUIP) AS CountOfEQUIP, tblskid.Code, tblskid.ID, tblskid.Name
FROM tblskid
GROUP BY tblskid.Code, tblskid.ID, tblskid.Name;


this query above comes back 4, please help me from sending all the data to a function using a recordset that's the only way I can get 1. Sorry for the space formatting.

Thank you for your attention to this issue.
Reply With Quote