Discussion Board for collaboration related to QlikView App Development.
Hi all, please advise what's wrong with the following script, thanks!
VBELN KUNNR BSTNK
VKGRP VKORG VTWEG
SPART AUDAT VDATU
AUART WAERK KNUMV
FAKSK ERNAM VKBUR
KTEXT ERDAT ERZET
from VBAK WHERE
/QTQVC/OPEN_STREAM failed after 00:00:00 Key = SQL_ERROR (ID:00 Type:E Number:001 Comma without preceding colon (after OPEN ?).)
The SQL WHERE clause is sent to the DB driver as is (after doing the dollar sign expansion only), and your driver probably doesn't know the QV Date() function.
Either use a function that is supported by the driver, or compare the field directly with a properly formatted variable.
Do it like this :
let vYesterday = date(Today()-1,'YYYYMMDD'); // Dates in SAP are like this
trace >> $(vYesterday); //
/QTQVC/OPEN_STREAM failed after 00:00:00 Key = SQL_ERROR (ID:00 Type:E Number:001 "'20131015'" is not a valid comparison operator.)
It still reports error
you may also have to use date variable in your script like below:
$(#vYesterday) or '$(#vYesterday)'
A good article on Date fields by Henric at here: QlikView Date fields