There is a little problem with your script. You load the field LASTMODIFIEDDATE from the QVD but you try to read the field LastModifiedDate to save in the variable. Change the line
LET vLastExecTime = peek('LastModifiedDate',0,'LoadTime');
LET vLastExecTime = peek('LASTMODIFIEDDATE',0,'LoadTime');
and see if it solves the problem.
Thank you Bruno,
Now I have to somehow fix the format. I think I am just not capable to create timestamp valid in SQL
this is the issue now:
ErrorSource: OraOLEDB, ErrorMsg: ORA-01843: not a valid month
and rank =1
and LASTMODIFIEDDATE >= '26.06.2014 23:45:14'
and LASTMODIFIEDDATE < '28.06.2014 11:01:04'
So we have to figureout the timestamp format of your database. Let's try setting the variables like this:
LET vExecTime = Timestamp(LocalTime(), 'MM-DD-YYYY hh:mm:ss');
LET vLastExecTime = Timestamp(Peek('LASTMODIFIEDDATE'), 'MM-DD-YYYY hh:mm:ss');
If it doesn't work, try changing the 'MM-DD-YYYY hh:mm:ss' until it matches the DB timestamp format.
Oracle Timestamp literal format is
TIMESTAMP 'YYYY-MM-DD hh:mm:ss'
Note the string "TIMESTAMP" is part of the specification, that's not a QV function.
If you use Qlikview Components (QVC) to do your incremental loads, QVC has knowledge of the formats used by various databases.