Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where Clause & Join

I am trying to exclude fields that do not have a date entry in the following field. It works with a where clause but only for the field. I additionally would like to exlcude all values that are linked to this empty field especially the values in the field "auftragswert". How can I do this? Do I have to join the two tables?

This is my code:

SQL SELECT "job_nummer",

    jobnr,

    "datum_auftrag",

    Year ("datum_auftrag") as Jahr,

    Month ("datum_auftrag") as Monat,

    "nur_kv"

  

FROM EASY.job where "datum_auftrag" is not null;

load *, [auf_kurs] * [auf_wert] / 100 as [Auftragswert];

SQL SELECT "auf_datum",

    "auf_fw",

    "auf_kurs",

    "auf_wert",

    bez,

    jobnr,

    "auf_anzahl",

    ltyp

FROM EASY.jleistg;

Thank you for your help!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

It will be:

Table1:

SQL SELECT "job_nummer",

    jobnr,

    "datum_auftrag",

    Year ("datum_auftrag") as Jahr,

    Month ("datum_auftrag") as Monat,

    "nur_kv"

FROM EASY.job where "datum_auftrag" is not null;

Table2:

LEFT KEEP (Table1)

load *, [auf_kurs] * [auf_wert] / 100 as [Auftragswert];

SQL SELECT "auf_datum",

    "auf_fw",

    "auf_kurs",

    "auf_wert",

    bez,

    jobnr,

    "auf_anzahl",

    ltyp

FROM EASY.jleistg;

View solution in original post

2 Replies
Anonymous
Not applicable
Author

It will be:

Table1:

SQL SELECT "job_nummer",

    jobnr,

    "datum_auftrag",

    Year ("datum_auftrag") as Jahr,

    Month ("datum_auftrag") as Monat,

    "nur_kv"

FROM EASY.job where "datum_auftrag" is not null;

Table2:

LEFT KEEP (Table1)

load *, [auf_kurs] * [auf_wert] / 100 as [Auftragswert];

SQL SELECT "auf_datum",

    "auf_fw",

    "auf_kurs",

    "auf_wert",

    bez,

    jobnr,

    "auf_anzahl",

    ltyp

FROM EASY.jleistg;

Not applicable
Author

Awesome! Thank you Michael.