473,387 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

an access query for a confused banker


I use Access to run reports from various pieces of financial data. The
one query that I have been unable to produce, but need is the following:

A query that yields all accounts from a person that has a loan account
with us but no deposit account. Luckily, all loan information is kept
in a 'loan' table and deposit is kept in a 'deposit' table with a few
common fields such as account number.

What I tried doing was to pull 'account number' from 'loan' and
'deposit' tables and use NULL for deposit info. and IS NOT NULL for loan
info so that records with valid Loan info. that was without deposit info
would be pulled.

This yielded results, but not the type that I was looking for because
John Doe, for instance, can have 5 accounts and if only one of those
accounts satisfies this critera, then John Doe's name will be pulled.
This query can only be useful if ALL of the records associated with John
Doe fall under this criteria otherwise one record will and one record
won't and his name will be displayed when it shouldn't.

Have I thoroughly confused everyone? I know this doesn't make much
sense, but if anyone can point me in the right direction, I'd be a
happy man.

Thanks
--
Posted via http://dbforums.com
Nov 12 '05 #1
2 2099
Create and save one query that gets all loan accounts grouped by person-id
(one record per person), and with no other columnns. Create and save
another query that gets all deposit accounts grouped by person-id, and with
no other columns. Now, make another query that outer joins from the fist
query to the second, and check for Null in the person-id column from the
second.

This gets one intance of each relevant person-id - I think you can take it
from there.

On Mon, 15 Sep 2003 15:27:54 -0400, jh8735 <me*********@dbforums.com>
wrote:

I use Access to run reports from various pieces of financial data. The
one query that I have been unable to produce, but need is the following:

A query that yields all accounts from a person that has a loan account
with us but no deposit account. Luckily, all loan information is kept
in a 'loan' table and deposit is kept in a 'deposit' table with a few
common fields such as account number.

What I tried doing was to pull 'account number' from 'loan' and
'deposit' tables and use NULL for deposit info. and IS NOT NULL for loan
info so that records with valid Loan info. that was without deposit info
would be pulled.

This yielded results, but not the type that I was looking for because
John Doe, for instance, can have 5 accounts and if only one of those
accounts satisfies this critera, then John Doe's name will be pulled.
This query can only be useful if ALL of the records associated with John
Doe fall under this criteria otherwise one record will and one record
won't and his name will be displayed when it shouldn't.

Have I thoroughly confused everyone? I know this doesn't make much
sense, but if anyone can point me in the right direction, I'd be a
happy man.

Thanks


Nov 12 '05 #2
From what you have posted, you need to create an unmatched records query. Go to
queries, click on new and select Find Unmatched Query Wizard. In the first
screen select your loan table as having the records you want. When you click
next, select your deposit table as having the related records. Click next again
and select account number in both tables and then click on the double arrow
button. Click next again and choose the fields you want to see in the results.
When you click Finish you will get all the people that have a loan account with
you but no deposit account.
--
PC Datasheet
A Resource for Access, Excel and Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
"jh8735" <me*********@dbforums.com> wrote in message
news:33****************@dbforums.com...

I use Access to run reports from various pieces of financial data. The
one query that I have been unable to produce, but need is the following:

A query that yields all accounts from a person that has a loan account
with us but no deposit account. Luckily, all loan information is kept
in a 'loan' table and deposit is kept in a 'deposit' table with a few
common fields such as account number.

What I tried doing was to pull 'account number' from 'loan' and
'deposit' tables and use NULL for deposit info. and IS NOT NULL for loan
info so that records with valid Loan info. that was without deposit info
would be pulled.

This yielded results, but not the type that I was looking for because
John Doe, for instance, can have 5 accounts and if only one of those
accounts satisfies this critera, then John Doe's name will be pulled.
This query can only be useful if ALL of the records associated with John
Doe fall under this criteria otherwise one record will and one record
won't and his name will be displayed when it shouldn't.

Have I thoroughly confused everyone? I know this doesn't make much
sense, but if anyone can point me in the right direction, I'd be a
happy man.

Thanks
--
Posted via http://dbforums.com

Nov 12 '05 #3

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

Similar topics

10
by: Marco Alting | last post by:
Hi, I'm still confused about my queries, I want to do something is ASP that is easily done in Access. I'll post the Access queries below as a reference. The main idea is that the queries depend...
3
by: Jon Ole Hedne | last post by:
My Access 2002-application need to work with tables from both Oracle and Access. To solve this, I want to run some querys on three views in Oracle and import the results into temporary...
5
by: rob | last post by:
Hi to all. I am pretty new to using Access and am having a problem I hope someone can help me with. I want to access a MS-Access database from a web page. I have managed to get it "sort" of...
2
by: Robert | last post by:
I built a query in Query Analyzer and mapped it to Access 2002. The result set returned is identical except cells in some records in the Access result have #Deleted. This cast a shadow of doubt...
3
by: Eric Ellsworth | last post by:
Hi all, Does anyone have any bright ideas for Access' tendency to add square brackets when it parses queries, then tell you that the query syntax is invalid. In my case, I'm trying to do a LEFT...
3
by: Dan | last post by:
I hate it when people think that their own misunderstandings are bugs in the program, but this time I think I've got something. If I run the following SQL code in Access 2000, I get unexpected...
6
by: InnoCreate | last post by:
Hi everyone. I've recently written a classic asp website which uses an MS Access datasource. I know this is less than an ideal data source as it has limited functionality. I have a search form on...
2
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
4
by: myemail.an | last post by:
Hi all, I use Access 2007 and have the following problems: when exporting banal select queries (either to Excel or to a csv file) I find that exporting often doesn't work and creates a file with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.