Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 83
  • Last Modified:

How do I show the total amount of a equipment used on a assignment?

I need the total amount of times a piece of equipment was used in a assignment. Not sure if to use a count statement or group by.
Screenshot--884-_LI.jpg
0
Rob Fried
Asked:
Rob Fried
2 Solutions
 
RayData AnalystCommented:
replace the assignmentID with ...
 count(*)

then at the very end add ....
GROUP BY equipment.serialno, name
0
 
Pawan KumarDatabase ExpertCommented:
Try

SELECT e.SerialNo AS [Serial No] , MAX(Name) AS Name, COUNT(*) AS [TotalNumberOfTimeEquipmentIsUsed]
FROM Equipment AS e
LEFT OUTER JOIN Assignment AS a
ON e.SerialNo = a.SerialNo
GROUP BY e.SerialNo 

Open in new window

0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now