Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Incremental load, load part of data from SQL with WHERE, not working.

Hi everyone,

So I am attempting to do incremental loads from an SQL
database with an ODBC connection. I have it working pulling from Excel, but
when I connect it to SQL instead, it is pulling every record instead of the
records I asked for in the ‘WHERE’ section.

I do not know if it is a syntax problem or if I am just
missing something, it seems to all be correct because it is pulling the
records, but it’s just pulling far too many. I have looked around on the forum
for similar problems but I am yet to see an answer.

I am hoping one of you can help me. Here is the code I am
using below:


LET vDateReload = Date(ReloadTime(),'DD/MM/YYYY  hh:mm:ss[.fff]');

//----- Collect updated records -----

ODBC CONNECT TO Database (XUserId is “”, XPassword is “”);

TABLE:
    
LOAD
          
Now() as [QV Added],
           *;

SQL SELECT *
FROM "Database".dbo."Table" WHERE "LAST_UPDATED" >= '$(vDateReload)';

Many thanks in advance,

Bruno

2 Replies
anbu1984
Master III
Master III

Try using convert function on '$(vDateReload)'

Not applicable
Author

I have tried converting it to all sort of things. I have even tried to put an actual timestamp instead of the variable and it still loads everything. It is very odd..