SQL

M

Melinda

I am pretty much a new at Access, so please be patient. I am posting the
SQL at the bottom for a query in which I need to roll back overtime for each
and every employee. I have a column in my table in which defines overtime
worked, overtime refused, etc., etc. When I roll back the overtime I need
to zero out any overtime that was refused. How can I incorporate this into
this query?

INSERT INTO tblhours ( EmployeeName, TMSEmployeeNo, DateWorked,
OvertimeCodes, HoursWorked )
SELECT tblHours.EmployeeName, tblHours.TMSEmployeeNo, Date() AS X,
"Rollback" AS Y, -[Enter the number of hours to rollback] AS Z
FROM tblEmployees INNER JOIN tblHours ON tblEmployees.Tmsemployeeno =
tblHours.TMSEmployeeNo
GROUP BY tblHours.EmployeeName, tblHours.TMSEmployeeNo, "Rollback", -[Enter
the number of hours to rollback], tblEmployees.ClassNo, tblEmployees.OutPost
HAVING (((tblEmployees.ClassNo)="52133") AND ((tblEmployees.OutPost)>-1));
 

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

Similar Threads


Top