Tables - need codes?

just2cool

Registered User.
Local time
Yesterday, 16:09
Joined
Jun 20, 2007
Messages
16
Hi, I have the following problem.

I have three tables, Main Table, Table A and Table B. All three tables have a field called "Cutoff Time". The Main Table will look up the info from Tables A and B. Table A has a field called "Service". In the main table, there is also a field called "Service", which is same as the field in Table A. The condition is this: The main table should use the "Service" field to match the "Service" field in Table A to get the "Cutoff Time" from Table A. If there is no such match, then the "Cutoff Time" will be taken from Table B using another field called "Station".
I was wondering, how can I perform such an operation? Do I need to write SQL statements?

Thanks in advance!
 
Because there is a priority of searching, you will need to consider two queries in a row. Run your first update query to update where a data match exists. Run the second query to update where a data match exists AND the first query didn't update. This presumes that you have a way to determine whether an update DID occur. (Perhaps a zero in a field neediing an update?)If it is only two queries, you can build them separately and then execute them in the right sequence via a macro.
 

Users who are viewing this thread

Back
Top Bottom