473,725 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Having problem creating an SQL stat. for a report

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

Aug 10 '06 #1
3 1666
Anything keeping you from creating two separate reports and then
dropping them into another report? then they'll have separate
rowsources and that's perfectly fine.

otherwise, you need to union the two tables together. Makes me wonder
why the data isn't all in one table to begin with. Just add a field to
the table so that you can distinguish what kind of expense it is.

Aug 10 '06 #2
"erick-flores" <ch**********@h otmail.comwrote in
news:11******** **************@ m79g2000cwm.goo glegroups.com:
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.
That's because you should not have added the second table. What you
should have done was put a new column called expense_type, (I'd use
text, 1 character, validation to allow only 'C' or 'R' and no nulls
allowed.
Thank you


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Aug 10 '06 #3
I got it...thank you guys

Aug 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1616
by: Paulo Pinto | last post by:
I am doing an application that needs to know when it is manipulating symbolic links. But it is failing to reckognize them. If I run the following code: <code> import sys import os
3
9538
by: Steven T. Hatton | last post by:
I found the following two statements in the file linked below: struct stat st; stat(fileName.c_str(), &st); http://websvn.kde.org/branches/work/kdevelop4-parser/main.cpp?rev=420247&view=markup This is from /usr/include/sys/stat.h which I'm pretty sure is what #include <sys/stat.h> is pulling in. I plain and simply do not understand what the above two lines of code do. Can someone please explain?
1
2914
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access 2000. The access file is in access 2000 format. I have a form that will hold the relevent parameters for the query/report that reports the statistics for all job records that match a certain criteria. These are: - A Customer Name.
5
3161
by: diadia | last post by:
#include <sys/types.h> #include <sys/stat.h> #include "ctype.h" #include <stdio.h> int estimateLen(struct stat buf, FILE *fp) { size_t _size = buf.st_size / 4;
3
3946
by: David Bear | last post by:
I'm trying to use os.chmod and am refered to the stat module. Is there are explanation of: * S_ISUID * S_ISGID * S_ENFMT * S_ISVTX * S_IREAD * S_IWRITE * S_IEXEC
1
3183
by: jmalone | last post by:
I have a python script that I need to freeze on AIX 5.1 (customer has AIX and does not want to install Python). The python script is pretty simple (the only things it imports are sys and socket). The README file in the Tools/freeze directory of the Python-2.4.4 distribution says the following (and many other things): Previous versions of Freeze used a pretty simple-minded algorithm to
24
6116
by: Joe Salmeri | last post by:
I just upgraded from Python 2.4.2 to Python 2.5.1 and have found some unexpected behavior that appears to be a bug in the os.stat module. My OS is Windows XP SP2 + all updates. I have several programs that have worked flawlessly on all previous Python versions for years and they are now producing incorrect results in the code that uses os.stat. Searching through the 2.5.1 release notes I found the following:
3
7003
by: Deniz Dogan | last post by:
Hello. I have a question regarding the st_mode field of the "stat" struct in sys/stat.h. I'd like to know how to use the S_IRWXU, S_IRWXG and S_IRWXO flags to mask the mode_t value into human readable form such as 755, 644, etc. Currently I do something similar to this: usr_t = (mod & S_IRWXU); usr_r = (mod & S_IRUSR);
6
7104
by: onLINES | last post by:
I'm running into an issue. To my understanding, when lstat() returns -1 (FAILURE) it's because it hit a broken link? If that is not the case, then how can i retrieve information on either a broken link, or even a soft link?
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.