Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Database system Load on data selection

Dear all,

I have a script where data can be loaded based on the date selection:

ODBC CONNECT TO [ASBASE.nlgo.prod;DBQ=ASBASE.nlgo.prod] (UserId is XFT12, Password is UtRWs);
Charge:
LOAD  STARTTMS,PROCESORDER
WHERE  STARTTMS >= '01-08-16' AND AFDELINGNR = '402';
SELECT
AFDELINGNR,
STARTTMS,
PROCESORDER
FROM TRACK."CB_CHARGE";

The above script works excellent.

If I have defined a variable:

Let eStart_ASBASE = NOW()-2;

WHERE  STARTTMS >= $(eStart_ASBASE)  AND AFDELINGNR = '402';

this works also very good.

But NOT:

Let eStart_ASBASE = '01-08-16';

WHERE  STARTTMS >= $(eStart_ASBASE)  AND AFDELINGNR = '402';

there is no error reporting from QV however, the generated table contauins a list of all available date instead >= 01-08-16.

I have already tried this: 

Let eStart_ASBASE = Date#('01-08-2016', 'DD-MM-YY');

But no solution, so far.

Any idea how to tackle this problem?

Best regards,

Cornelis

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try with single quotes around the variable expansion:

Let eStart_ASBASE = '01-08-16';

WHERE  STARTTMS >= '$(eStart_ASBASE)' AND AFDELINGNR = '402';

View solution in original post

2 Replies
swuehl
MVP
MVP

Try with single quotes around the variable expansion:

Let eStart_ASBASE = '01-08-16';

WHERE  STARTTMS >= '$(eStart_ASBASE)' AND AFDELINGNR = '402';

Not applicable
Author

Hi Stefan,

Yes!

I have misunderstood the color of the script. Putting into quotation mark will turn variable from gray to black and I thought is was an error, but actually not.

thank you for your swift reply.

Best regards,

Cornelis