S
Shanin
I keep getting variable results from the following query.
SELECT tktimcrd.employee, Trim([name]) & ", " & Trim([first_name]) AS
EmployeeName, (Sum(IIf([pay_type] Not In ("P","S","Y","Z"),[hours]))) AS
Regular, (Sum(IIf([pay_type] In ("P","Y"),[hours]))) AS Personal,
(Sum(IIf([pay_type] In ("S","Z"),[hours]))) AS Sick, Sum(tktimcrd.hours) AS
SumOfhours
FROM py_emplo INNER JOIN tktimcrd ON py_emplo.employee = tktimcrd.employee
WHERE (((tktimcrd.work_date) Between [Start Date] And [End Date]))
GROUP BY tktimcrd.employee, Trim([name]) & ", " & Trim([first_name])
WITH OWNERACCESS OPTION;
The results never seem to be the same. Sometimes it'll add a few hours to
one employee, the next time to someone else, and then sometimes it will just
mix names, for example, say I have a steve smith and a john doe, everynow and
then it will give some hours to an employee named steve doe. I'm not sure if
this has to do since it's pulling the data from a foxpro database and the
field name for last name is "name" which if I'm remembering is a reserved
word in Access. Any help would be appreciated.
SELECT tktimcrd.employee, Trim([name]) & ", " & Trim([first_name]) AS
EmployeeName, (Sum(IIf([pay_type] Not In ("P","S","Y","Z"),[hours]))) AS
Regular, (Sum(IIf([pay_type] In ("P","Y"),[hours]))) AS Personal,
(Sum(IIf([pay_type] In ("S","Z"),[hours]))) AS Sick, Sum(tktimcrd.hours) AS
SumOfhours
FROM py_emplo INNER JOIN tktimcrd ON py_emplo.employee = tktimcrd.employee
WHERE (((tktimcrd.work_date) Between [Start Date] And [End Date]))
GROUP BY tktimcrd.employee, Trim([name]) & ", " & Trim([first_name])
WITH OWNERACCESS OPTION;
The results never seem to be the same. Sometimes it'll add a few hours to
one employee, the next time to someone else, and then sometimes it will just
mix names, for example, say I have a steve smith and a john doe, everynow and
then it will give some hours to an employee named steve doe. I'm not sure if
this has to do since it's pulling the data from a foxpro database and the
field name for last name is "name" which if I'm remembering is a reserved
word in Access. Any help would be appreciated.