Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
BSinatra
Starting Member
13 Posts |
Posted - 2007-08-09 : 17:04:16
|
| This is what I have tried:SELECT PATIENTS.PatientID, PATIENTS.Email, PATIENTS.Name, PATIENTS.BirthDate, PATWEB.PatientID, PATWEB.Answer, PATWEB.PIN, PATWEB.AnswerFROM PATIENTS, PATWEBWHERE PATIENTS.Name LIKE 'xxx%' AND PATIENTS.PatientID = PATWEB.PatientIDAND PATWEB.PIN = '55555' AND PATIENTS.Email = 'bbbb@xyz.net'AND PATIENTS.BirthDate = '1900-01-1\01'AND PATWEB.Answer = 'snoopy' UPDATE PATIENTS SET PATIENTS.Email = 'bb@cc.com' I just need to update the Email field in PATIENTS tablewhen data matches some field in the PATWEB table and other data in the PATIENTS table from a set where PATWEB.PatientID = PATIENTS.PatientIDThanks |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-08-09 : 17:08:14
|
someting like this:UPDATE PSET P.Email = 'bb@cc.com' FROM PATIENTS PJOIN PATWEB PW ON P.PatientId= PW.PatientIdWHERE P.Name LIKE 'xxx%' AND PW.PIN = '55555' AND PP.Email = 'bbbb@xyz.net'AND P.BirthDate = '1900-01-1\01'AND PW.Answer = 'snoopy' Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
BSinatra
Starting Member
13 Posts |
Posted - 2007-08-09 : 17:17:55
|
Okay 2 for 2 today, thanks very much! |
 |
|
|
|
|
|