Purpose of Sum(1)

Derek

Registered User.
Local time
Today, 06:24
Joined
May 4, 2010
Messages
234
please see the screenshot attached. Just wanted to know what is the purpose of Sum(1) in query design?


Thanks
 
Pupose of Sum(1)

Can anyone please let me know the purpose of Sum(1) in the attached screenshot?

Thanks
 

Attachments

Re: Pupose of Sum(1)

it is just counting how many [staff id]/[staff name] on tblAction.
 
Re: Pupose of Sum(1)

arnelgp, please See attached the other screenshot. What is Sum(1) doing in this? As there are 3 tables in total and in Sum(1) , table name is not mentioned so which table it refers too?

Thanks
 

Attachments

Duplicate threads merged, since both had replies. Please don't post the same question twice.
 
Code:
 SELECT tblstaff.[Staff Name], Sum(1) AS Expr2 FROM (tblstaff INNER JOIN tblAction ON tblstaff.[Staff Number] = tblAction.Owner) INNER JOIN tblActionChange ON tblAction.ActionID = tblActionChange.ActionID GROUP BY tblstaff.[Staff Name], IIf([DateChanged]>=#4/1/2016# And [DateChanged]=#4/1/2016# And [DateChanged]
 

Users who are viewing this thread

Back
Top Bottom