A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update Query Question



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2008, 11:14 PM posted to microsoft.public.access.queries
NeonSky via AccessMonster.com
external usenet poster
 
Posts: 89
Default 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  
Old July 8th, 2008, 11:36 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old July 9th, 2008, 12:04 AM posted to microsoft.public.access.queries
NeonSky via AccessMonster.com
external usenet poster
 
Posts: 89
Default 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  
Old July 9th, 2008, 12:41 AM posted to microsoft.public.access.queries
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.