Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Where statement

Hello experts

I would like to exclude values in a field that are in the future using a where statement:

SQL SELECT "auf_datum",

    bez as Leistungstext,

    jobnr,

    "auf_anzahl",

    ltyp,

    storniert,

    optional,

    verkauf_soll as VK_soll,

    verkauf_ist as VK_ist,

    einkauf_ist as EK_ist,

    auf_brutto as EK_soll,

    jznr,

    lartnr 

FROM EASY.jleistg where storniert = 0 and optional = 0 and "auf_datum" < (here I would like to load the actual date);

Does anyone know how to read the date in there?

Thank you for your help!

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi Try below

"auf_datum" < replace(cast(curdate() as char(10)), '-', '.');


OR


"auf_datum" < CURRENT_DATE();


Regards

ASHFAQ



View solution in original post

10 Replies
ashfaq_haseeb
Champion III
Champion III

Hi Which database you use

Regards

ASHFAQ

ashfaq_haseeb
Champion III
Champion III

try Below

SQL SELECT "auf_datum",

    bez as Leistungstext,

    jobnr,

    "auf_anzahl",

    ltyp,

    storniert,

    optional,

    verkauf_soll as VK_soll,

    verkauf_ist as VK_ist,

    einkauf_ist as EK_ist,

    auf_brutto as EK_soll,

    jznr,

    lartnr

FROM EASY.jleistg where storniert = 0 and optional = 0 and "auf_datum" < DATE(CURDATE())

Regards

ASHFAQ

Not applicable
Author

pervasive

ashfaq_haseeb
Champion III
Champion III

Dear,

sara leslie

Again no points awarded in this thread.

Regards

ASHFAQ

Not applicable
Author

this one did not work...

ashfaq_haseeb
Champion III
Champion III

Hi can you tell me in which format you have dates?

and is this date field or string?

Regards

ASHFAQ

Not applicable
Author

Thank you for your help

the format is dd.mm.yyyy

ashfaq_haseeb
Champion III
Champion III

Hi Try below

"auf_datum" < replace(cast(curdate() as char(10)), '-', '.');


OR


"auf_datum" < CURRENT_DATE();


Regards

ASHFAQ



Not applicable
Author

Hi!

Never used such database, but you can use qlikview for this purpose:

load *

where storniert = 0 and optional = 0 and auf_datum < DATE(today())

;

SQL SELECT "auf_datum",

    bez as Leistungstext,

    jobnr,

    "auf_anzahl",

    ltyp,

    storniert,

    optional,

    verkauf_soll as VK_soll,

    verkauf_ist as VK_ist,

    einkauf_ist as EK_ist,

    auf_brutto as EK_soll,

    jznr,

    lartnr

FROM EASY.jleistg