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 Question
Good Afternoon,
Wow I am surprised I am having so much trouble with something that is so simple...perhaps you can tell me if what I am trying to do is even possible. I would like to do multiple updates within a single query, can I establish something similar to the "logic" below? Thank you! UPDATE tblWeeklyBase SET tblWeeklyBase.CONVERTED1 = "Daily" WHERE (((tblWeeklyBase.CCODE)="D")), SET tblGRCWeeklyBase.CONVERTED1 = "Occupy" WHERE (((tblGrcWeeklybase.CCODE)="LD")); -- Message posted via http://www.accessmonster.com |
#2
|
|||
|
|||
Update Query Question
I do not think it will work with two WHERE statements and you have two
different tables - tblGrcWeeklybase and tblWeeklyBase. How are they related? If it was one table then I think you could use an IIF statement. -- KARL DEWEY Build a little - Test a little "NeonSky via AccessMonster.com" wrote: Good Afternoon, Wow I am surprised I am having so much trouble with something that is so simple...perhaps you can tell me if what I am trying to do is even possible. I would like to do multiple updates within a single query, can I establish something similar to the "logic" below? Thank you! UPDATE tblWeeklyBase SET tblWeeklyBase.CONVERTED1 = "Daily" WHERE (((tblWeeklyBase.CCODE)="D")), SET tblGRCWeeklyBase.CONVERTED1 = "Occupy" WHERE (((tblGrcWeeklybase.CCODE)="LD")); -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Update Query Question
Hello Karl how careless of me... please consider the correct sample text.
Thank you! UPDATE tblWeeklyBase SET tblWeeklyBase.CONVERTED1 = "Daily" WHERE (((tblWeeklyBase.CCODE)="D")), SET tblWeeklyBase.CONVERTED1 = "Occupy" WHERE (((tblWeeklybase.CCODE)="LD")); KARL DEWEY wrote: I do not think it will work with two WHERE statements and you have two different tables - tblGrcWeeklybase and tblWeeklyBase. How are they related? If it was one table then I think you could use an IIF statement. Good Afternoon, [quoted text clipped - 8 lines] SET tblGRCWeeklyBase.CONVERTED1 = "Occupy" WHERE (((tblGrcWeeklybase.CCODE)="LD")); -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200807/1 |
#4
|
|||
|
|||
Update Query Question
UPDATE tblWeeklyBase
SET CONVERTED1 = Switch([CCODE] & " ='D'", "Daily", [CCODE] & " = 'LD'", "Occupy") WHERE tblWeeklyBase.CCODE IN ("D", "LD") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "NeonSky via AccessMonster.com" u23580@uwe wrote in message news:86dc920dc099a@uwe... Hello Karl how careless of me... please consider the correct sample text. Thank you! UPDATE tblWeeklyBase SET tblWeeklyBase.CONVERTED1 = "Daily" WHERE (((tblWeeklyBase.CCODE)="D")), SET tblWeeklyBase.CONVERTED1 = "Occupy" WHERE (((tblWeeklybase.CCODE)="LD")); KARL DEWEY wrote: I do not think it will work with two WHERE statements and you have two different tables - tblGrcWeeklybase and tblWeeklyBase. How are they related? If it was one table then I think you could use an IIF statement. Good Afternoon, [quoted text clipped - 8 lines] SET tblGRCWeeklyBase.CONVERTED1 = "Occupy" WHERE (((tblGrcWeeklybase.CCODE)="LD")); -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...eries/200807/1 |
Thread Tools | |
Display Modes | |
|
|