X
x01kgb
Hey all,
teaching myself access and have a question about a certain query:
The following is the SQL although I created the query in design view, can
anybody point me in a direction of getting this query to show data as of now
nothing is showing:
SELECT tblAMParttime_HPW.EmployeeID, tblEmployees.FirstName,
tblEmployees.LastName, tblBegin_End_Date.WeekBegin,
[tblAMParttime_HPW].[Monday_Hours]+[tblDayshift_HPW].[Monday_Hours]+[tblMidnight_HPW].[Monday_Hours]+[tblNightWeekend_HPW].[Monday_Hours]
AS TotalMonday,
[tblAMParttime_HPW].[Tuesday_Hours]+[tblDayshift_HPW].[Tuesday_Hours]+[tblMidnight_HPW].[Tuesday_Hours]+[tblNightWeekend_HPW].[Tuesday_Hours]
AS TotalTuesday,
[tblAMParttime_HPW].[Wednesday_Hours]+[tblDayshift_HPW].[Wednesday_Hours]+[tblMidnight_HPW].[Wednesday_Hours]+[tblNightWeekend_HPW].[Wednesday_Hours]
AS TotalWednesday,
[tblAMParttime_HPW].[Thursday_Hours]+[tblDayshift_HPW].[Thursday_Hours]+[tblMidnight_HPW].[Thursday_Hours]+[tblNightWeekend_HPW].[Thursday_Hours]
AS TotalThursday,
[tblAMParttime_HPW].[Friday_Hours]+[tblDayshift_HPW].[Friday_Hours]+[tblMidnight_HPW].[Friday_Hours]+[tblNightWeekend_HPW].[Friday_Hours]
AS TotalFriday,
[tblAMParttime_HPW].[Saturday_Hours]+[tblDayshift_HPW].[Saturday_Hours]+[tblMidnight_HPW].[Saturday_Hours]+[tblNightWeekend_HPW].[Saturday_Hours]
AS TotalSaturday,
[tblAMParttime_HPW].[Sunday_Hours]+[tblDayshift_HPW].[Sunday_Hours]+[tblMidnight_HPW].[Sunday_Hours]+[tblNightWeekend_HPW].[Sunday_Hours] AS TotalSunday
FROM tblEmployees INNER JOIN (tblBegin_End_Date INNER JOIN
(((tblAMParttime_HPW INNER JOIN tblDayshift_HPW ON tblAMParttime_HPW.ID =
tblDayshift_HPW.ID) INNER JOIN tblMidnight_HPW ON tblAMParttime_HPW.ID =
tblMidnight_HPW.ID) INNER JOIN tblNightWeekend_HPW ON tblAMParttime_HPW.ID =
tblNightWeekend_HPW.ID) ON (tblBegin_End_Date.WeekBegin =
tblNightWeekend_HPW.Begin_Date) AND (tblBegin_End_Date.WeekBegin =
tblMidnight_HPW.Begin_Date) AND (tblBegin_End_Date.WeekBegin =
tblDayshift_HPW.Begin_Date) AND (tblBegin_End_Date.WeekBegin =
tblAMParttime_HPW.Begin_Date)) ON (tblEmployees.EmployeeID =
tblNightWeekend_HPW.EmployeeID) AND (tblEmployees.EmployeeID =
tblMidnight_HPW.EmployeeID) AND (tblEmployees.EmployeeID =
tblDayshift_HPW.EmployeeID) AND (tblEmployees.EmployeeID =
tblAMParttime_HPW.EmployeeID);
I have 4 hour tables (crappy I know) that I want to sum the hours for by day
and then total the hours for the week. Running this query doesn't produce an
error but gives no data, I would think at least with an error that would lead
me to some more information!
Thanks in advance for any advice.
x01kgb
teaching myself access and have a question about a certain query:
The following is the SQL although I created the query in design view, can
anybody point me in a direction of getting this query to show data as of now
nothing is showing:
SELECT tblAMParttime_HPW.EmployeeID, tblEmployees.FirstName,
tblEmployees.LastName, tblBegin_End_Date.WeekBegin,
[tblAMParttime_HPW].[Monday_Hours]+[tblDayshift_HPW].[Monday_Hours]+[tblMidnight_HPW].[Monday_Hours]+[tblNightWeekend_HPW].[Monday_Hours]
AS TotalMonday,
[tblAMParttime_HPW].[Tuesday_Hours]+[tblDayshift_HPW].[Tuesday_Hours]+[tblMidnight_HPW].[Tuesday_Hours]+[tblNightWeekend_HPW].[Tuesday_Hours]
AS TotalTuesday,
[tblAMParttime_HPW].[Wednesday_Hours]+[tblDayshift_HPW].[Wednesday_Hours]+[tblMidnight_HPW].[Wednesday_Hours]+[tblNightWeekend_HPW].[Wednesday_Hours]
AS TotalWednesday,
[tblAMParttime_HPW].[Thursday_Hours]+[tblDayshift_HPW].[Thursday_Hours]+[tblMidnight_HPW].[Thursday_Hours]+[tblNightWeekend_HPW].[Thursday_Hours]
AS TotalThursday,
[tblAMParttime_HPW].[Friday_Hours]+[tblDayshift_HPW].[Friday_Hours]+[tblMidnight_HPW].[Friday_Hours]+[tblNightWeekend_HPW].[Friday_Hours]
AS TotalFriday,
[tblAMParttime_HPW].[Saturday_Hours]+[tblDayshift_HPW].[Saturday_Hours]+[tblMidnight_HPW].[Saturday_Hours]+[tblNightWeekend_HPW].[Saturday_Hours]
AS TotalSaturday,
[tblAMParttime_HPW].[Sunday_Hours]+[tblDayshift_HPW].[Sunday_Hours]+[tblMidnight_HPW].[Sunday_Hours]+[tblNightWeekend_HPW].[Sunday_Hours] AS TotalSunday
FROM tblEmployees INNER JOIN (tblBegin_End_Date INNER JOIN
(((tblAMParttime_HPW INNER JOIN tblDayshift_HPW ON tblAMParttime_HPW.ID =
tblDayshift_HPW.ID) INNER JOIN tblMidnight_HPW ON tblAMParttime_HPW.ID =
tblMidnight_HPW.ID) INNER JOIN tblNightWeekend_HPW ON tblAMParttime_HPW.ID =
tblNightWeekend_HPW.ID) ON (tblBegin_End_Date.WeekBegin =
tblNightWeekend_HPW.Begin_Date) AND (tblBegin_End_Date.WeekBegin =
tblMidnight_HPW.Begin_Date) AND (tblBegin_End_Date.WeekBegin =
tblDayshift_HPW.Begin_Date) AND (tblBegin_End_Date.WeekBegin =
tblAMParttime_HPW.Begin_Date)) ON (tblEmployees.EmployeeID =
tblNightWeekend_HPW.EmployeeID) AND (tblEmployees.EmployeeID =
tblMidnight_HPW.EmployeeID) AND (tblEmployees.EmployeeID =
tblDayshift_HPW.EmployeeID) AND (tblEmployees.EmployeeID =
tblAMParttime_HPW.EmployeeID);
I have 4 hour tables (crappy I know) that I want to sum the hours for by day
and then total the hours for the week. Running this query doesn't produce an
error but gives no data, I would think at least with an error that would lead
me to some more information!
Thanks in advance for any advice.
x01kgb