Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sokkorn
Master
Master

SAP Where DateField > '01-01-2011' Not Working

Dear All,

Please see the load script below:







[ConditionDate]:

LOAD

ERDAT

AS [F1],

DATE

(ERDAT,'dd.MMM.yyyy') AS [F2],

NUM(ERDAT) AS [F3];

SELECT

WHERE

ERDAT >= '01-01-2011';

When finished execute script I got all date data. Mean that where condition not working.

Note: I try to get data from SQL Database it ok with condition above, but I face the problem when try with SAP.

Please advice me to do this.

Thanks in advance!



ERDAT FROM VBAK



7 Replies
Not applicable

In SAP the date columns wont be format of date mostly it will be like this '!11122010' so pull that in same way then take of character out make the date format in this way

DATE(LEFT([Docdate],2)&'/'&MID([Docdate],4,2)&'/'&RIGHT([Docdate],4),'DD/MM/YYYY') as Docdate.

maneshkhottcpl
Partner - Creator III
Partner - Creator III

first check ur ERDAT formate

if it is in datetime formate then ok

else

use date(makedate(left(ERDAT,4),mid(ERDAT,5,2),right(ERDAT,2)),'DD-MM-YYYY')

Sokkorn
Master
Master
Author

Hi

Thanks for your quick reply.

I have list down the field data and see in format (dd-MM-yyyy). Ex. 01-01-2010, 01-01-2011, 01-02-2011

When use where ERDAT > '01-01-2011', like example above it should be return 01-01-2011, 01-02-2011

but after finished load, I got all data (01-01-2010, 01-01-2011, 01-02-2011)

What I do wrong with this?

Please help.

maneshkhottcpl
Partner - Creator III
Partner - Creator III

Hi,

use where date(makedate(right(ERDAT,4),mid(ERDAT,4,2),left(ERDAT,2)),'DD-MM-YYYY') > '01-01-2011'

for any issue u can post me.

Not applicable

debug ur data and send the application with 10 records...

Not applicable

In SAP the date format is YYYYMMDD. You should be using the ERDAT>='YYYYMMDD'.

Sokkorn
Master
Master
Author

This one is correct for me ERDAT >'YYYYMMDD'

Many thank everybody!