Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ritumishra01
Contributor III
Contributor III

Error while running script

LET WHERE_PART_TEMP ='AND TRUNC(EBT_CARD_DETL.STAT_DATE) BETWEEN TO_DATE(' & chr(39) &$(FromDateKey)& chr(39) &chr(44) &chr(39)&'MM/DD/YYYY'&chr(39)&') AND TO_DATE(' & chr(39)&$(ToDateKey)& chr(39) &chr(44) &chr(39)&'MM/DD/YYYY'&chr(39)&')';
while runnig this i am getting below error message:


Unexpected token: '&', expected one of: '(', 'Yellow', 'ZTestw_z', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'not', 'bitnot', ..

Labels (1)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

It could be the $(FromDateKey) and/or  $(ToDateKey) that is giving you trouble (if the content is empty or a string), try this adjusted expression. 

LET WHERE_PART_TEMP ='AND TRUNC(EBT_CARD_DETL.STAT_DATE) BETWEEN TO_DATE(' & chr(39) &'$(FromDateKey)'& chr(39) &chr(44) &chr(39)&'MM/DD/YYYY'&chr(39)&') AND TO_DATE(' & chr(39)&'$(ToDateKey)'& chr(39) &chr(44) &chr(39)&'MM/DD/YYYY'&chr(39)&')';

View solution in original post

1 Reply
Vegar
MVP
MVP

It could be the $(FromDateKey) and/or  $(ToDateKey) that is giving you trouble (if the content is empty or a string), try this adjusted expression. 

LET WHERE_PART_TEMP ='AND TRUNC(EBT_CARD_DETL.STAT_DATE) BETWEEN TO_DATE(' & chr(39) &'$(FromDateKey)'& chr(39) &chr(44) &chr(39)&'MM/DD/YYYY'&chr(39)&') AND TO_DATE(' & chr(39)&'$(ToDateKey)'& chr(39) &chr(44) &chr(39)&'MM/DD/YYYY'&chr(39)&')';