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.

 All Forums
 Other Forums
 MS Access
 Updating 2 fields from a 3rd field

Author  Topic 

nicka
Starting Member

28 Posts

Posted - 2002-09-30 : 11:28:06
I have in a table "tbl_Main" 3 fields "First", "Second", "Third" in question.

From "First" I need to transfer info and feed into "Second" and "Third". Keep in Mind that "First" has only 4 different combinations. Either Blank (empty or Null), Or "A", or "B", or "A,B"

These three conditions have to be met:

1)If "First" has a Blank OR "A,B" Then BOTH "Second" and "Third" are updated with a value "0%".

2)If "First" has "A" Then I need to update "Second" with the value "100%" AND "Third" with the Value "0%"

3)If "First" has "B" Then I need to update "Second" with the value "0%" AND "Third" with the Value "100%"

Help

Thanks,


AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-10-01 : 08:42:11
this seems to be a DUPLICATE of.....http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=20315

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2002-10-01 : 09:07:28
This is the access version of the question.

You should be able to do a similar thing with iif.

second = iif("" & First in ("A,B","B",""),"0%","100%")


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -