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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Update query based on different conditions
Hello:
I have 3 queries and 1 table (ID as primary key). Is there any way that a update query can deal with 3 conditions and update "Status"? if a.ID=b.ID, then a.Status="Possible" if a.ID=c.ID, then a.Status="Probable" If a.ID=d.ID, then a.Status="Confirmed" If not, what would be the solution? Thanks in advance! |
#2
|
|||
|
|||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Looks like 3 UPDATEs are required: UPDATE a INNER JOIN b ON a.ID = b.ID SET a.Status = 'Possible' UPDATE a INNER JOIN c ON a.ID = c.ID SET a.Status = 'Probable' UPDATE a INNER JOIN d ON a.ID = d.ID SET a.Status = 'Confirmed' -- MGFoster:::mgf00 at earthlink decimal-point net Oakland, CA (USA) -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBQTUBjoechKqOuFEgEQIHsACfT0w9X/mq5Scf+YJRypMMLnKZUP0AniOJ 3hyPXK5iER+xOc0kGjB3jw0w =MHl9 -----END PGP SIGNATURE----- Vincdc wrote: Hello: I have 3 queries and 1 table (ID as primary key). Is there any way that a update query can deal with 3 conditions and update "Status"? if a.ID=b.ID, then a.Status="Possible" if a.ID=c.ID, then a.Status="Probable" If a.ID=d.ID, then a.Status="Confirmed" If not, what would be the solution? Thanks in advance! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Taher | Setting Up & Running Reports | 1 | August 31st, 2004 09:07 PM | |
Update a query to value in another table | Tim | Running & Setting Up Queries | 1 | August 13th, 2004 11:35 PM |
EXISTS reserved word in FROM clause | Stephanie Doherty | Running & Setting Up Queries | 6 | July 21st, 2004 01:15 AM |
Update Query Type Conversion Failure | Running & Setting Up Queries | 2 | July 7th, 2004 06:52 PM | |
Update Query Problem | Casa | General Discussion | 1 | June 14th, 2004 04:17 PM |