Sunday, March 11, 2012

Advanced find and replace

I have two tables.
One table contains ID numbers for individuals (Ind_ID), and ID numbers for
their family unit (Fam_ID), there isn't any words in this table just numbers.
The information in the Fam_ID field would be like this: ID001, ID002, ID003,
ID004. This represents four people in this field. We'll call this table IDNum1
The other table has the a field that has each ID number that matches the
other table (IDNum1.Ind_ID) and another field that has the individual's names
(Names). We'll call this table IDNam1
I need to perform an update query that will:
Look at the table IDNum1 to see how many ID numbers there are in Fam_ID,
Go to IDNam1.Names, look at the ID number of the individuals
Write to a new table the names from IDNam1.Names according to the number of
IDs from IDNum1.Fam_ID.
The end result is a find and replace using IDNum1.Fam_ID as the structure
for the a new table that now contains only names from IDNam1.Names grouped in
families.
"Steve1445" <Steve1445@.discussions.microsoft.com> wrote in message
news:399D9D4B-083A-4934-A6F4-A60DE3F1C111@.microsoft.com...
>I have two tables.
> One table contains ID numbers for individuals (Ind_ID), and ID numbers for
> their family unit (Fam_ID), there isn't any words in this table just
> numbers.
> The information in the Fam_ID field would be like this: ID001, ID002,
> ID003,
> ID004. This represents four people in this field. We'll call this table
> IDNum1
> The other table has the a field that has each ID number that matches the
> other table (IDNum1.Ind_ID) and another field that has the individual's
> names
> (Names). We'll call this table IDNam1
> I need to perform an update query that will:
> Look at the table IDNum1 to see how many ID numbers there are in Fam_ID,
> Go to IDNam1.Names, look at the ID number of the individuals
> Write to a new table the names from IDNam1.Names according to the number
> of
> IDs from IDNum1.Fam_ID.
> The end result is a find and replace using IDNum1.Fam_ID as the structure
> for the a new table that now contains only names from IDNam1.Names grouped
> in
> families.
I'm not quite following all of this... Can you please provide DDL, some
sample data and the results you are looking for. See this for more
information:
http://www.aspfaq.com/etiquette.asp?id=5006
Rick Sawtell
MCT, MCSD, MCDBA

No comments:

Post a Comment