Group By Date question - date format needs to be "general"

C

chris

The following query groups various types of hours worked by date worked. The
date format is "general". My problem is that when two records share the same
date worked but the time is different, for example, the result set returns 2
rows instead of one. How do you force grouping by date regardless of time of
day. Thanks!

INSERT INTO LaborMaint2
SELECT DISTINCTROW LaborMaintTemp.[Clock Number] AS [Clock Number],
LaborMaintTemp.Name AS Name, LaborMaintTemp.[Date Worked] AS [Date Worked],
Sum(LaborMaintTemp.[Breakdown Hrs Worked]) AS [Breakdown Hrs Worked],
Sum(LaborMaintTemp.[PM Hrs Worked]) AS [PM Hrs Worked],
Sum(LaborMaintTemp.[Round Hrs Worked]) AS [Round Hrs Worked],
Sum(LaborMaintTemp.[Project Hrs Worked]) AS [Project Hrs Worked],
Sum(LaborMaintTemp.[Total Hrs Worked]) AS [Total Hrs Worked]
FROM LaborMaintTemp
WHERE (((LaborMaintTemp.[Date Worked]) > [Enter last day of PRIOR month as
mm/dd/yy: ]))
GROUP BY LaborMaintTemp.[Date Worked], LaborMaintTemp.[Clock Number],
LaborMaintTemp.Name
ORDER BY LaborMaintTemp.[Clock Number];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top