Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
francofiorillo
Partner - Creator
Partner - Creator

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

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