Re: Merging/Eliminating Redundant Columns
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Tue, 31 Jul 2007 16:10:34 -0400
Add one more query to the end
SELECT ...
UNION
SELECT ID1, Property_Name
FROM TABLE_NAME
WHERE ID1 is Null and ID2 is Null and ID3 Is Null
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"Housing Intern" <HousingIntern@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7F3F5A4A-57D4-4E10-A7D4-66BF92692DA7@xxxxxxxxxxxxxxxx
Thank you, that worked beautifully. One more problem...Some of the
properties did not have an ID number in any of the three columns. When I
ran
the SQL, it eliminated these properties. What can I add to the SQL so
that
it will still keep these properties even though they do not have an ID
number? Thanks again.
"Jerry Whittle" wrote:
SELECT ID1 AS ID, Property_Name
FROM TABLE_NAME
WHERE ID1 IS NOT NULL
UNION
SELECT ID2 AS ID, Property_Name
FROM TABLE_NAME
WHERE ID2 IS NOT NULL
UNION
SELECT ID3 AS ID, Property_Name
FROM TABLE_NAME
WHERE ID3 IS NOT NULL ;
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
"Housing Intern" wrote:
Hello,
I am creating a query from several different tables containing housing
data.
My final goal is to create one query that contains a single column
with the
"housing ID number" along with all of the other housing information in
each
row (address, owner, management...) Due to poor data management, this
"housing ID number" is missing from several of my tables.
By running a series of queries from all these different tables, a have
a
data*** that has three columns with ID numbers. Some rows have all
the
data, some do not. As an example of my columns:
ID1 ID2 ID3 Property_Name
321 321 321 Greystone
244 244 Buena Vista
545 Moore
Since sometimes the original tables DID have the ID number, it shows up
two
or three times, like in the example above. Other times, this ID number
was
missing in one or more tables. I want a final table that gets rid of
these
redundant ID numbers, so the final product looks like:
ID Property_Name
321 Greystone
244 Buena Vista
545 Moore
Any help will be greatly appreciated. Thank you.
.
- Prev by Date: Re: finding all the records in a query with the same first name
- Next by Date: Re: Help with syntax while using the expression builder within a q
- Previous by thread: Re: finding all the records in a query with the same first name
- Next by thread: Re: Correleted Sub Query with joins and aliases
- Index(es):