Question : Access 2007 Update Multiple Columns with a twist

Hello to All,

Is there a way to write a query in Microsoft Access 2007 to update a certain column only if the column prior is filled with text. And if so move on to the next column. My problem is I have five different columns in tables that all represent specific dates. I need to join these tables together and then add a new single date to each table on the next readily available column. The only problem is all the next available columns could be any one of those five columns..... Can this be solved? And what do I need to do to solve it?

Any help on this would be greatly appreciated. Even a little lesson in the IIF function, I was hoping to accomplish this with it, but no luck.

Thanks,
Frank

Answer : Access 2007 Update Multiple Columns with a twist

The basic logic for the UpdateTo cell in columns 2 -5 is:

iif(thiscolumn is null and previouscolumn is not null, newvalue, currentvalue)

which will look something like this for field2 (the corresponding entry goes in columns 3,4,5)
iif(isnull(field2) and not isnull(field1), #2010/01/01#, Field2)

For the first column you only need...
iif(isnull(field1), #2010/01/01#,field1)
Random Solutions  
 
programming4us programming4us