473,545 Members | 721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2122
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*********@db forums.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******@pcdata sheet.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*********@db forums.com> wrote in message
news:33******** ********@dbforu ms.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
2328
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 on each other in a hierarchical manner. It all works fine in Access, but in the last query (Qrylevel3CostTotals) there's a criteria which I would...
3
23433
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 Access-tables. I have tried this: conn.Provider = "Microsoft.Jet.OLEDB.4.0" conn.ConnectionString = "data source=" & datafil & ";Jet OLEDB:Database...
5
7342
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 working using MS-Access's 'data access page' function as it were. This creates a web page that is linked to a database table. The problem that I have...
2
1612
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 on the reliability of Access. Am I doing something incorrect? Comments? Access query SELECT .Account, .Region_nm, .Site, dbo_Results. FROM ...
3
3336
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 JOIN on a subquery, like so: SELECT DISTINCT . FROM LEFT JOIN (SELECT FROM targetMarkers WHERE targetID = Forms!frmTargetDetails ) as TM ON ....
3
1923
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 results: SELECT MY_FIELD FROM ( SELECT NULL AS MY_FIELD FROM DUAL
6
5463
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 my website which allows users to define parameters and return results accordingly. The problem i have is a need to return these results in a random...
2
6060
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 can't get it working. I have a query defined (view) and want the end user to put in a start date and end date to filter a report.
4
2378
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 the WHOLE dataset, i.e. including those rows which the criteria of the query excluded. For example: let's say I have a database with sales by...
0
7465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7398
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...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5969
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...
1
5325
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...
0
4944
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...
0
3449
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...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.