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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Querying from 2 Records



 
 
Thread Tools Display Modes
  #1  
Old June 11th, 2004, 07:12 PM
external usenet poster
 
Posts: n/a
Default Querying from 2 Records

I need to pull information from two fields in a table into
one field in another. I am trying to condense it into one
step but didn't know if it was possible. Right now I have
to run a query for the one record and then go append the
results from the second query into the record.
  #2  
Old June 12th, 2004, 01:22 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default Querying from 2 Records

Why? As in "what business need do you have that requires you to redundantly
store data in two tables?" Generally, storing redundant data is not
necessary in Access -- what's being "solved" can often be solved without
resorting to redundant copies of the same data.

And again, why? As in "why do you need to combine data from separate fields
into one?" A tenant of good relational database design is that you DON'T
store more than one fact in one field -- you are describing store two facts
in one field.

If you need to SEE the two fields combined, that's what queries are for.

--
More info, please ...

Jeff Boyce
Access MVP

  #3  
Old June 14th, 2004, 01:50 PM
external usenet poster
 
Posts: n/a
Default Querying from 2 Records

This is what is happening. In the customer table there
are 8 different categories of various accounts. For our
reporting purposes we don't care about the differences and
need to run certain processes on these numbers. I have to
basically streamline the current database and I am trying
to eliminate as much extra work as possible. Right now
there are 8 different queries, 1 that makes a table and
the rest to append all of the different accounts to this
one table. I was trying to make it work with one query
but that is where I was hitting a wall. When I try to
combine them all, I only get instances where they match
across, which doesn't happen. I tried changes the AND to
an OR and it just crashes the query. I can't go back and
make changes to the main system because it is a custom
application that was designed by one of our vendors. I
import their tables and am sort of handcuffed by their
initial design. This is a sample of what I am trying to
do -

INSERT INTO [OD Case#] ( Account, CaseID )
SELECT Overdrafts.Account, tblCase.CASEID
FROM tblCase INNER JOIN Overdrafts ON (Overdrafts.Account
= tblCase.CUSTOMERACCOUNTNUMBER2) OR
(tblCase.CUSTOMERACCOUNTNUMBER1 = Overdrafts.Account);


It will run if I change the OR to an AND, but again the
results are wrong.







-----Original Message-----
Why? As in "what business need do you have that requires

you to redundantly
store data in two tables?" Generally, storing redundant

data is not
necessary in Access -- what's being "solved" can often be

solved without
resorting to redundant copies of the same data.

And again, why? As in "why do you need to combine data

from separate fields
into one?" A tenant of good relational database design

is that you DON'T
store more than one fact in one field -- you are

describing store two facts
in one field.

If you need to SEE the two fields combined, that's what

queries are for.

--
More info, please ...

Jeff Boyce
Access MVP

.

 




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 02:57 PM.


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