Qlik Community

QlikView Connectors

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Where clause with Date comparison in SAP Connector

Hi,

I'm trying to get rows from some SAP tables, depending on the date they've been created/modified.

The "SQL" statement I'm trying to use looks like:

CUSTOM CONNECT TO "Provider=QvSAPConnector.dll ...

Load *;

SQL SELECT *

FROM  TABLE

WHERE DateField = '2011/01/11';

STORE  TABLE INTO  ANY.QVD;

How can I define correctly my date definition for my where clause? I'm trying almost everything but it doesn't work.

Thanks for your help in advance,

Aitor.

1 Solution

Accepted Solutions

Re: Where clause with Date comparison in SAP Connector

Hi Aitor,

Try instead

WHERE DateField = '20110111';

Hope that helps.

Miguel

5 Replies

Re: Where clause with Date comparison in SAP Connector

Hi Aitor,

Try instead

WHERE DateField = '20110111';

Hope that helps.

Miguel

Not applicable

Re: Where clause with Date comparison in SAP Connector

Ok,

after some tries, I found the way:

LOAD

*;

SQL SELECT *

FROM  TABLE

WHERE DateField <= '20080303' and DateField >= '20080302';

Now I can also do this.

Not applicable

Re: Where clause with Date comparison in SAP Connector

Thanks Miguel for your answer,

I was writing my own conclussions when you posted yours (XD).

As we say, that way works.

Thanks again,

Aitor.

Not applicable

Re: Where clause with Date comparison in SAP Connector

Making this script more complicated, anyone know how to write it, storing the date value into a variable?

My scripting code looks like this:

$date = '20111215';

BKPF_Server:

Load

[BUKRS]&[BELNR]&[GJAHR] as BPKFServerKey,

[BUKRS],

[BELNR],

[GJAHR],

'BKPF-Server' as Provenance_BKPF;

SQL Select BUKRS BELNR GJAHR CPUDT AEDAT from BKPF

where CPUDT = '$(date)' or AEDAT = '$(date)';

But using variable it brings me 0 records instead of the 26K records using the hand-typed value e.g.:'20081003' in 'YYYYMMDD' fromat.

I trid modifying date variable with Date(Date#(date,'YYYYMMDD'),'YYYYMMDD') and similar things, but nothing seems to work.

Any idea?

Thanks in advance.

Aitor.

Not applicable

Re: Where clause with Date comparison in SAP Connector

Hi,

Try using this code:

let date = '20111215';

.

.

.

.

where CPUDT = $(date) or AEDAT = $(date);

regards,

Ronald

Community Browser