Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
francofiorillo
Contributor

DateTime field in sql

hello.

in a variable

let test = peek ('maxdata');

I have a decimal number (eg. 41535.528542708) that represents the date and time of a field stored in a QVD file.

To do an incremental load, I have to compare this value to a DateTime field, TBModified of Sql server 2008 R2, placed on a table SQL.

I can not, because of my ignorance, to write correctly the Where clause

eg.

LOAD

....

TBModified;

Sql Select *

FROM DBtableName

where TBModified> = test;

where the comparison is not done correctly and / or I get a conversion error.

thank you in advance for your help.

hello

1 Reply
mov
Esteemed Contributor III

Re: DateTime field in sql

You got the reason right, it is about data format.  Recommendation:
- format your vaiable as date/time: let test = timestamp(peek ('maxdata'));
- condition should be where TBModified> = '$(test)'

See if it helps.

Regards,

Michael

Community Browser