Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Im having a problem with something and trying to solve it for like 2 days now, without anny solutions.
What i want to create is an extra field which is filled with the date field from table VDO (if they are filled), if not i want to use the dates from Table2 (Or table1 if its easier, because they are equal).
I couldnt solve this problem because i wasn't able to use fields from other tables at once. Like use date-year from Table1 and Per-date1 from VDO at the same time.
I have this (3) tables:
TABLE1:
LOAD *,
ID & '_' & date-year & '_' & [date-month] as Key;
SQL SELECT ID,
date-year,
date-month
Amount-eur,
FROM Table1;
TABLE2:
LOAD *,
yID & '_' & yDateYear & '_' & yDateMonth as Key;
SQL SELECT yID,
date-year as yDateYear,
date-month as yDateMonth,
ID_VDO
FROM Table2;
LOAD *,
Year([Per-date1]) as VdoYear,
Month([Per-date1]) as VdoMonth;
SQL SELECT ID_VDO,
Per-date1,
FROM VDO;
Try this.
Load *,if(isnull(Per-date1) or Per-date1='',date-year, Per-date1) as New_Date ;
SELECT a.yID,
a.date-year as yDateYear,
a.date-month as yDateMonth,
a.ID_VDO,
b.Per-date1
From Tabl2 a, VDO b
where a.ID_VDO = b.ID_VDO
Regards,
Kaushik Solanki
Hi,
Try like this.
Load *;
SELECT a.yID,
a.date-year as yDateYear,
a.date-month as yDateMonth,
a.ID_VDO,
b.Per-date1
From Tabl2 a, VDO b
where a.ID_VDO = b.ID_VDO
Regards,
Kaushik Solanki
I succesfully connected the tables.
The thing i want is:
If date from VDO is filled then take it, if not use the date from Table2.
Kind regards,
Triglobal
Try this.
Load *,if(isnull(Per-date1) or Per-date1='',date-year, Per-date1) as New_Date ;
SELECT a.yID,
a.date-year as yDateYear,
a.date-month as yDateMonth,
a.ID_VDO,
b.Per-date1
From Tabl2 a, VDO b
where a.ID_VDO = b.ID_VDO
Regards,
Kaushik Solanki
I've got it quite working as i wanted.
The only problem right now is that I lose the results from table VDO that don't have a ID_VDO filled.
Do you have anny solution for this?
Thanks so much!!