Home > Archive > MS SQL Server > October 2006 > Pulling Data from more than one UNLINKED table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pulling Data from more than one UNLINKED table
JC HARRIS

2006-10-24, 6:31 pm

I am new to this so hopefully you'll bare with me if this is a stupid
question.

I receive data in a dbf format from the state office on a yearly basis. I
have figured out how to use SSIS to pull these into the SQL system as
different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
The state has a habit of changing the fields names from year to year, and
what I would like to do is build standard queries that compares one year to
the next. Since I cannot link this data (it is prenatal birth data) on any
field because there is no like field from one year to the next, what would a
query look like, say, to compare birth_hospital in 2002, 2003, and 2004.

I have three separate Select statements that pulls and groups the data, but
they are feeding into separate panes (one for each year). How do I get them
in one pane side-by-side?

TIA

Any help is appreciated.


Dan

2006-10-24, 6:31 pm

SELECT birth_date, birth_hospital
FROM Birth2002

UNION

SELECT BirthDate, BirthHospital
FROM Birth2003

UNION

SELECT Bdte, BHosp
FROM Birth2004



"JC HARRIS" wrote:

> I am new to this so hopefully you'll bare with me if this is a stupid
> question.
>
> I receive data in a dbf format from the state office on a yearly basis. I
> have figured out how to use SSIS to pull these into the SQL system as
> different tables (e. Birth2002, Birth2003, Birth2004) within a single DB.
> The state has a habit of changing the fields names from year to year, and
> what I would like to do is build standard queries that compares one year to
> the next. Since I cannot link this data (it is prenatal birth data) on any
> field because there is no like field from one year to the next, what would a
> query look like, say, to compare birth_hospital in 2002, 2003, and 2004.
>
> I have three separate Select statements that pulls and groups the data, but
> they are feeding into separate panes (one for each year). How do I get them
> in one pane side-by-side?
>
> TIA
>
> Any help is appreciated.
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com