Is it at all possible to make the determination of which columns to update in an update statement conditional?
I am trying to run an update query to update one of 30 columns per record, but only if the previous field in the record is already filled in. Basically I have a table with projects and a table with donors. Each project has 1 to 4 donors, but each donor has funded between 1 and 25 projects. The projects page is filled in with donors, and so I am trying to automatically fill in the donors with projects they have funded. So far my attempt is as follows. (The query from which I am updating is a query that selects fields when the donors from the donor table equal donor 1 or donor 2 or donor 3 or donor 4 from the project table) :
UPDATE [Appropriate Query]
SET (iif([Project Funded 1 title] is null OR [project funded 1 title] <>
[Project title], [project funded 1 title], iif([project funded 2 title]
is null OR [project funded 1 title] <> [Project title], [project funded 2 title]))
= Iif([Project title] is null, [cc number], [project title])
(i have this nested loop first SET part looped for 30 columns. the second part of my code is because some of the "project title" fields are empty but I need some identifier in the field)
So far I have only gotten error messages. Is it at all possible to make the determination of which columns to update conditional on their contents as illustrated above? I know the iif statement is ugly, but JET SQL (the language of access) doesn't allow case statements, from what I understand.
Thank you so much, and forgive my ignorance.