A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Pulling records based of another tables, column



 
 
Thread Tools Display Modes
  #1  
Old December 24th, 2008, 08:10 PM posted to microsoft.public.access.tablesdbdesign
mary
external usenet poster
 
Posts: 1,946
Default Pulling records based of another tables, column

Hello all..
I am really really in need of a help. This query of my project has hold me
back now for months. The project is to develop a database.

I have two tables, table1 and table2. Table 1 has the following columns and
rows:
ID Audit
223 2
234 3
225 1
226 2
The column ID is unique, have one record per row and Audit is not unique.

Here are the columns and rows for table 2. Records in column ID are unique
but can have more than one record per rows. Amt Type is grouped by Trans
type. Example, cash and visa are credit Trans type; where as, all MC and TC
are paytogo.

ID Amt Amt type Trans Type
223 1.50 cash credit
223 2.03 visa credit
223 2.30 MC paytogo
234 .50 TC paytogo
234 1.75 cash credit
234 .90 visa credit
234 5.30 visa credit
234 1.25 TC paytogo
225 1.35 MC paytogo
225 2.24 visa credit
225 3.35 MC paytogo
226 2.17 visa credit
226 1.15 TC paytogo
226 1.50 TC paytogo
226 1.60 visa credit

I would like a sql statement or know how to create a query that will look at
column Audit of table1. For every Audit in table1 pull the corresponding
records in table 2 and sort in order by Amt.Table2. I really do not care
about the order. Just would like for it to pull the records from table2 based
of Audit.table1.


The result for this query should be. From the result below. There are 3
records for ID 234, 1 record for ID 225, 2 records for ID 223 and 2 records
for ID 226
ID Amt Amt type Trans Type
234 5.30 visa credit
234 1.25 TC paytogo
234 1.75 cash credit
225 3.35 MC paytogo
223 2.30 MC paytogo
223 2.03 visa credit
226 2.17 visa credit
226 1.60 visa credit

Any help will be greatly appreciated as this has been holding be back from
completing this project. I am opened to any direction.
Thanks a million in advance.

  #2  
Old December 24th, 2008, 08:50 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Pulling records based of another tables, column

On Wed, 24 Dec 2008 12:10:01 -0800, Mary
wrote:

Hello all..
I am really really in need of a help. This query of my project has hold me
back now for months. The project is to develop a database.


Answered in microsoft.public.access.queries (the Queries window). Please do
not "multipost" - post the same question in multiple groups. Doing so wastes
the volunteers' time answering questions that have already been answered in
another group.

--

John W. Vinson [MVP]
  #3  
Old December 29th, 2008, 11:26 PM posted to microsoft.public.access.tablesdbdesign
lourdesbolla
external usenet poster
 
Posts: 6
Default Pulling records based of another tables, column

Hello!!You´re the Microsoft?
That is my cash?
Please speak in Portugues or Spanish please .I not alcansee this number
....not is propice for Brazil.
You ´ve tranking for mi?
Its Beutifoul!
Lourdes.

"Mary" escreveu na notÃ*cia da
...
Hello all..
I am really really in need of a help. This query of my project has hold me
back now for months. The project is to develop a database.

I have two tables, table1 and table2. Table 1 has the following columns
and
rows:
ID Audit
223 2
234 3
225 1
226 2
The column ID is unique, have one record per row and Audit is not unique.

Here are the columns and rows for table 2. Records in column ID are unique
but can have more than one record per rows. Amt Type is grouped by Trans
type. Example, cash and visa are credit Trans type; where as, all MC and
TC
are paytogo.

ID Amt Amt type Trans Type
223 1.50 cash credit
223 2.03 visa credit
223 2.30 MC paytogo
234 .50 TC paytogo
234 1.75 cash credit
234 .90 visa credit
234 5.30 visa credit
234 1.25 TC paytogo
225 1.35 MC paytogo
225 2.24 visa credit
225 3.35 MC paytogo
226 2.17 visa credit
226 1.15 TC paytogo
226 1.50 TC paytogo
226 1.60 visa credit

I would like a sql statement or know how to create a query that will look
at
column Audit of table1. For every Audit in table1 pull the corresponding
records in table 2 and sort in order by Amt.Table2. I really do not care
about the order. Just would like for it to pull the records from table2
based
of Audit.table1.


The result for this query should be. From the result below. There are 3
records for ID 234, 1 record for ID 225, 2 records for ID 223 and 2
records
for ID 226
ID Amt Amt type Trans Type
234 5.30 visa credit
234 1.25 TC paytogo
234 1.75 cash credit
225 3.35 MC paytogo
223 2.30 MC paytogo
223 2.03 visa credit
226 2.17 visa credit
226 1.60 visa credit

Any help will be greatly appreciated as this has been holding be back from
completing this project. I am opened to any direction.
Thanks a million in advance.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.