Helpful SQL for the day
Terrible problems in the time tracking system - well, not in the tracking, but in the reporting; people are apparently working 20 hour days?
Root cause was in the master list of “contracts” that folks could charge time against - some dups got in there (long post, some other time). Nothing like a quick GROUP BY / COUNT() query to identify the offending records.
SELECT ContractName, ContractCode, COUNT(ContractCode) AS CountMe
FROM tblContracts
GROUP BY ContractName, ContractCode
HAVING (COUNT(ContractCode) > 1)