Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I believe I have a very simple problem.
I have got two tables and want to calculate sth. with one field of each of them. They are connected by the ID.
Table1:
------------
ID
Name
Days
Table2:
------------
ID
DaysOff
Now I want to subtract Days-DaysOff as a new field in Table1.
So I started like this:
left join (Table1) LOAD ID, Days-DaysOff as TotalDays resident Table2;
I also switched Table1 and Table2 but I dont get it. TotalDays should be a field of Table1. In the best case I do not want to JOIN them. I know this would be a solution.
Thanks in advance!
Hi
You are correct, both fields need to be in Table1 before you can calculate TotalDays. The way to do it is like this
Join (Table1)
LOAD ID,
DaysOff
Resident Table2;
Join (Table1)
LOAD ID,
Days - DaysOff As TotalDays
Resident Table1;
DROP Field DaysOff from Table1;
Hope that helps
Jonathan
Hi
You are correct, both fields need to be in Table1 before you can calculate TotalDays. The way to do it is like this
Join (Table1)
LOAD ID,
DaysOff
Resident Table2;
Join (Table1)
LOAD ID,
Days - DaysOff As TotalDays
Resident Table1;
DROP Field DaysOff from Table1;
Hope that helps
Jonathan
Hi,
totally what I thought, thanks a lot!