Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update query with conditional fields

Status
Not open for further replies.

topwaya

Technical User
May 4, 2005
150
US
Hi,

I have the following update query that I haven't tried yet:

Code:
UPDATE tblPersonal INNER JOIN ParticipantListing ON tblPersonal.User = ParticipantListing.User SET ParticipantListing.[START DATE]= "tblPersonal", ParticipantListing.[START DATE]= "tblPersonal", ParticipantListing.Email = "tblAddr", ParticipantListing.ADDR1 = "tblPersonal", ParticipantListing.ADDR2 = "tblAddr", ParticipantListing.City = "tblAddr", ParticipantListing.State = "tblAddr", ParticipantListing.ZIP = "tblAddr", ParticipantListing.PhoneH = "tblAddr", ParticipantListing.PhoneW = "tblAddr", ParticipantListing.BDay = "tblPersonal", ParticipantListing.SEX = "tblPersonal", ParticipantListing.Mtype = "tblPersonal", ParticipantListing.XLD = "tblPersonal", ParticipantListing.LocW = "tblPersonal", ParticipantListing.Pay = "tblPersonal", ParticipantListing.LocFC1 = "tblPersonal", ParticipantListing.NICK = "tblPersonal", ParticipantListing.Dept = "tblPersonal", ParticipantListing.Relation = "tblPersonal"
WHERE (([MEMBER STATUS]=". Yes A Member") AND ([LAST WEB VISIT] Is Not Null));

It isn't exactly what I would like to accomplish. What I would like it to do is:
******************
Update [ParticipantListing].[START DATE] AS tblPersonal.FCSD
IF [ParticipantListing].[MEMBER STATUS] = . Yes A Member
Or else leave the tblPersonal.FCSD blank.

AND

Update [ParticipantListing].[START DATE] AS tblPersonal.LOSD
IF [ParticipantListing].[LAST WEB VISIT] has any date, or is not null
Or else leave the tblPersonal.LOSD blank.
*********************************

Also, is there any way to APPEND the rest of the ParticipantListing table, where the USER fields do not match in one query?

Thanks very much for any help!
 
oops,
I guess I shouldn't have said:

or else leave the tblPersonal.LOSD and tblPersonal.FCSD "BLANK"

Instead I should have said just not to update that field.

Thanks for any help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top