I have a table called processtime
id | task1id | task1occ | task1time | task2id | task2occ | task2time | task3id | task3occ | task3time | task4id | task4occ | task4time | task5id | task5occ | task5time
----+---------+----------+-----------+---------+----------+-----------+---------+----------+-----------+---------+----------+-----------+---------+----------+-----------
10 | 9 | 0 | 300 | | | | | | | | | | | |
7 | 5 | 1 | 20 | 6 | 1 | 45 | 1 | 0 | 60 | | | | | |
9 | 6 | 1 | 45 | 7 | 1 | 120 | 2 | 0 | 110 | | | | | |
8 | 5 | 1 | 20 | 6 | 1 | 45 | 3 | 1 | 200 | 1 | 0 | 60 | 4 | 1 | 300
and table called test1
id | task1time | task2time | task3time | task4time | task5time
----+-----------+-----------+-----------+-----------+-----------
what i'm trying to do is if a value in any of the occ columns in processtime = 0 then the task time is displayed in the test1 time columns.
So test1 table should look like this . :
id | task1time | task2time | task3time | task4time | task5time
----+-----------+-----------+-----------+-----------+-----------
10 | 300 | | | |
7 | | | 60 | |
9 | | | 60 | |
8 | | | | 60 |
I have tried using OR and AND functions but they do not work, i was thinking a IF function might work , but don't know where to start if one
Many Thanks
Dave