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: 
Not applicable

sql where statment using variable

I am have problem, when I use the variable

let vExecTime='2015-03-25' in a load sql select statment,

sql where statement (WHERE MODIFIED < '$(ThisExecTime)')

return 0 records from sql table while when replace variable with '2015-03-25'  sql select statmen works?

Labels (1)
5 Replies
MK_QSL
MVP
MVP

MODIFIED should be in YYYY-MM-DD format !

Also check < or > depending upon your requirements.

anbu1984
Master III
Master III

Is it because you used wrong variable name in Sql??

(let vExecTime='2015-03-25' in a load sql select statment,)

sql where statement (WHERE MODIFIED < '$(ThisExecTime)')


Anonymous
Not applicable
Author

Try sql where statement (WHERE MODIFIED < '$(vExecTime)')

Not applicable
Author

anbu got it right! that was the fix;


I am trying to create a QVW that does incremental loads of large SQL tables that get updated daily. 


The scripting in Re: Re: Incremental Load Script

for case 4 worked fine until I added a second set of data (different SQL table) to save a 2nd QVD.  The script runs correctly for the 1st incremental load and creates an updated QVD then drops/ at end of second table right as it starts to store the 2nd QVD that has an incremental load with same scripting in case 2 (Load Insert/Update/Delete).

Not applicable
Author

anbu got it right! that was the fix;


I am trying to create a QVW that does incremental loads of large SQL tables that get updated daily.


The scripting in Re: Re: Incremental Load Script

for case 4 worked fine until I added a second set of data (different SQL table) to save a 2nd QVD.  The script runs correctly for the 1st incremental load and creates an updated QVD then drops/ at end of second table right as it starts to store the 2nd QVD that has an incremental load with same scripting in case 4 (Load Insert/Update/Delete).  typo both are case 4 incremental loads.