Jump to content

[SOLVED] Simple "Update" Query problem for pedigree


forTheDogs

Recommended Posts

Greetings to all!!

 

I have a database table [Pedigrees] with a list of RegName and their ID's.  The table also has a column for the dog's Sire and the SireID.  All the Sires are listed  in the RegName and ID columns.

 

ID    RegName    SireID  Sire

1      Rover                  Red

6      Red                      Buddy

 

 

 

I am trying to get the SireID updated by looking up the sires name in the RegName Col then taking the ID and putting it in the SireID field.  In this case, the SireID would be 6.  This is what I tried:

 

UPDATE Pedigrees

SET SireID=ID

Where Sire = RegName.

 

The query does nothing because it is trying to find a record where the Sire and the dog are the same and knows this is not possible!!

 

Is there a way to tell it to look in RegName for the Sire and take that ID?

 

Any help would be greatly appreciated!!!!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.