J
Justin
I'm accessing an MSAccess DB from within VB.NET. To start here is my OLD
select statement which works 100% and has provided the data I need for many
years:
SELECT TimeSheets.Employee, TimeSheets.[Hol Hours], TimeSheets.[Job Date],
TimeSheets.[Job Number], TimeSheets.[Over Hours], TimeSheets.[Period Start],
Employee.Employee AS Expr1, Employee.Type, TimeSheets.Dept, TimeSheets.GL
FROM (Employee INNER JOIN TimeSheets ON Employee.Employee =
TimeSheets.Employee) WHERE [Period Start] = @PeriodStart AND [Over Hours] >
0
You will notice I pull from TimeSheets and Employee. What I'm trying to do
now is add a third table "Jobs" to pull one more field into my report. Here
is my attempt:
SELECT TimeSheets.Employee, TimeSheets.[Hol Hours], TimeSheets.[Job Date],
TimeSheets.[Job Number], TimeSheets.[Over Hours], TimeSheets.[Period Start],
Employee.Employee AS Expr1, Employee.Type, TimeSheets.Dept, TimeSheets.GL,
Jobs.[Job Number], Jobs.[Job Name] FROM (Employee INNER JOIN TimeSheets ON
Employee.Employee = TimeSheets.Employee) INNER JOIN Jobs ON TimeSheets.[Job
Number] = Jobs.[Job Number] WHERE [Period Start] = @PeriodStart AND [Over
Hours] > 0
This results in an empty dataset. Nothing is selected form the DB. If I
remove the WHERE statement I get a very odd and very small dataset of
mismatched data. When I use the original select statement I get over 3,000
results. I'm expecting the exact same amount of result with the new select
statement only with a new field added (the name of the job).
I would appreciate any help on this matter and thanks in advance!!!
select statement which works 100% and has provided the data I need for many
years:
SELECT TimeSheets.Employee, TimeSheets.[Hol Hours], TimeSheets.[Job Date],
TimeSheets.[Job Number], TimeSheets.[Over Hours], TimeSheets.[Period Start],
Employee.Employee AS Expr1, Employee.Type, TimeSheets.Dept, TimeSheets.GL
FROM (Employee INNER JOIN TimeSheets ON Employee.Employee =
TimeSheets.Employee) WHERE [Period Start] = @PeriodStart AND [Over Hours] >
0
You will notice I pull from TimeSheets and Employee. What I'm trying to do
now is add a third table "Jobs" to pull one more field into my report. Here
is my attempt:
SELECT TimeSheets.Employee, TimeSheets.[Hol Hours], TimeSheets.[Job Date],
TimeSheets.[Job Number], TimeSheets.[Over Hours], TimeSheets.[Period Start],
Employee.Employee AS Expr1, Employee.Type, TimeSheets.Dept, TimeSheets.GL,
Jobs.[Job Number], Jobs.[Job Name] FROM (Employee INNER JOIN TimeSheets ON
Employee.Employee = TimeSheets.Employee) INNER JOIN Jobs ON TimeSheets.[Job
Number] = Jobs.[Job Number] WHERE [Period Start] = @PeriodStart AND [Over
Hours] > 0
This results in an empty dataset. Nothing is selected form the DB. If I
remove the WHERE statement I get a very odd and very small dataset of
mismatched data. When I use the original select statement I get over 3,000
results. I'm expecting the exact same amount of result with the new select
statement only with a new field added (the name of the job).
I would appreciate any help on this matter and thanks in advance!!!