S
Shanin
We have a timekeeping system in FoxPro and I linked to it with Access to be
able to view schedules, make reports, etc without having to pay for every
custom report we need. I set up this query below to pull up schedules by
employee:
SELECT tblDayofWeekList.DayNumber, tblDayofWeekList.DayofWeek, [LastName] &
", " & [FirstName] AS Employee, syjobcst.location, tkempsch.job,
tkempsch.department, TimeValue(Format([time_in],"@@\@")) AS StartTime,
TimeValue(Format([Expr1],"@@\@")) AS EndTime,
IIf([time_out]="2400","0000",[time_out]) AS Expr1, tkempsch.hours
FROM (MITCEmployeeList RIGHT JOIN (tkempsch INNER JOIN tblDayofWeekList ON
tkempsch.day_of_wk = tblDayofWeekList.DayNumber) ON MITCEmployeeList.employee
= tkempsch.employee) LEFT JOIN syjobcst ON tkempsch.job = syjobcst.job
WHERE (((tkempsch.date) Between #4/29/2007# And #5/5/2007#) AND
((MITCEmployeeList.EmployeeID)=[Forms]![MITCSchedulebyEmployee]![Combo0]))
ORDER BY tkempsch.date
WITH OWNERACCESS OPTION;
I would like to add one more thing which I've run into a kink with. The
line "WHERE (((tkempsch.date) Between #4/29/2007# And #5/5/2007#)" those
dates can actually be changed down the road in the timekeeping software. I
really don't want to have to come into the query each time and change them.
These dates are however stored in a table name tk_cntrl as Sch_from and
sch_to. If I try and change the date field to have Between sch_frm AND
sch_to, I get the ambiguous outer join error. Is there anyway I'd be able to
get that to pull this in since there is nothing in that table that links to
anything else.
able to view schedules, make reports, etc without having to pay for every
custom report we need. I set up this query below to pull up schedules by
employee:
SELECT tblDayofWeekList.DayNumber, tblDayofWeekList.DayofWeek, [LastName] &
", " & [FirstName] AS Employee, syjobcst.location, tkempsch.job,
tkempsch.department, TimeValue(Format([time_in],"@@\@")) AS StartTime,
TimeValue(Format([Expr1],"@@\@")) AS EndTime,
IIf([time_out]="2400","0000",[time_out]) AS Expr1, tkempsch.hours
FROM (MITCEmployeeList RIGHT JOIN (tkempsch INNER JOIN tblDayofWeekList ON
tkempsch.day_of_wk = tblDayofWeekList.DayNumber) ON MITCEmployeeList.employee
= tkempsch.employee) LEFT JOIN syjobcst ON tkempsch.job = syjobcst.job
WHERE (((tkempsch.date) Between #4/29/2007# And #5/5/2007#) AND
((MITCEmployeeList.EmployeeID)=[Forms]![MITCSchedulebyEmployee]![Combo0]))
ORDER BY tkempsch.date
WITH OWNERACCESS OPTION;
I would like to add one more thing which I've run into a kink with. The
line "WHERE (((tkempsch.date) Between #4/29/2007# And #5/5/2007#)" those
dates can actually be changed down the road in the timekeeping software. I
really don't want to have to come into the query each time and change them.
These dates are however stored in a table name tk_cntrl as Sch_from and
sch_to. If I try and change the date field to have Between sch_frm AND
sch_to, I get the ambiguous outer join error. Is there anyway I'd be able to
get that to pull this in since there is nothing in that table that links to
anything else.