Hello all
I am creating an Expense Report. There are to types of expenses:
Company expenses and Reimb Expeneses. The company expenses is under
"Expense Details Co" table and Reimb Expenses is under "Expense
Details" table. So I am creating this final report to see both type of
expenses separately but I CANT.
I got this report design from a website, but it only came with one
"Expense Details" table, so I add the Expense Details Co. The report
worked fine with only Expense Details but now that I am trying to add
the other table it wont work quite well for my final report.
Here is the SQL stat. that I am using to display the report, but again,
is not working the way I want.
I want to see in one group the Expense Details and on other group the
Expense Details Co.
SELECT DISTINCTROW [Expense Reports].*, [Expense
Details].ExpenseDetailI D, [Expense Details].ExpenseItemAmo unt, [Expense
Details].ExpenseItemDes cription, [Expense Details].ExpenseDate,
[Expense Categories].ExpenseCategor y, Employees.Emplo yeeNumber,
Employees.First Name, Employees.LastN ame, [Expense Details
Co].[EnpenseDetailID Co], [Expense Details Co].[ExpenseItemAmou nt Co],
[Expense Details Co].[ExpenseItemDesc ription Co], [Expense Details
Co].[ExpenseDate Co]
FROM (Employees INNER JOIN ([Expense Reports] INNER JOIN [Expense
Details Co] ON [Expense Reports].ExpenseReportI D = [Expense Details
Co].[ExpenseReportID Co]) ON Employees.Emplo yeeID = [Expense
Reports].EmployeeID) INNER JOIN ([Expense Categories] RIGHT JOIN
[Expense Details] ON [Expense Categories].ExpenseCategor yID = [Expense
Details].ExpenseCategor yID) ON [Expense Reports].ExpenseReportI D =
[Expense Details].ExpenseReportI D
WHERE ((([Expense Reports].ExpenseReportI D)=[forms]![Expense
Reports]![ExpenseReportID]));
I am almost sure that I have something wrong in the SQL but I dont know
where exactly..please help me
Thank you
I am creating an Expense Report. There are to types of expenses:
Company expenses and Reimb Expeneses. The company expenses is under
"Expense Details Co" table and Reimb Expenses is under "Expense
Details" table. So I am creating this final report to see both type of
expenses separately but I CANT.
I got this report design from a website, but it only came with one
"Expense Details" table, so I add the Expense Details Co. The report
worked fine with only Expense Details but now that I am trying to add
the other table it wont work quite well for my final report.
Here is the SQL stat. that I am using to display the report, but again,
is not working the way I want.
I want to see in one group the Expense Details and on other group the
Expense Details Co.
SELECT DISTINCTROW [Expense Reports].*, [Expense
Details].ExpenseDetailI D, [Expense Details].ExpenseItemAmo unt, [Expense
Details].ExpenseItemDes cription, [Expense Details].ExpenseDate,
[Expense Categories].ExpenseCategor y, Employees.Emplo yeeNumber,
Employees.First Name, Employees.LastN ame, [Expense Details
Co].[EnpenseDetailID Co], [Expense Details Co].[ExpenseItemAmou nt Co],
[Expense Details Co].[ExpenseItemDesc ription Co], [Expense Details
Co].[ExpenseDate Co]
FROM (Employees INNER JOIN ([Expense Reports] INNER JOIN [Expense
Details Co] ON [Expense Reports].ExpenseReportI D = [Expense Details
Co].[ExpenseReportID Co]) ON Employees.Emplo yeeID = [Expense
Reports].EmployeeID) INNER JOIN ([Expense Categories] RIGHT JOIN
[Expense Details] ON [Expense Categories].ExpenseCategor yID = [Expense
Details].ExpenseCategor yID) ON [Expense Reports].ExpenseReportI D =
[Expense Details].ExpenseReportI D
WHERE ((([Expense Reports].ExpenseReportI D)=[forms]![Expense
Reports]![ExpenseReportID]));
I am almost sure that I have something wrong in the SQL but I dont know
where exactly..please help me
Thank you
Comment