Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

chematos
Valued Contributor II

Incremental load date format problem

Hi, I´m trying to do an incremental load but this is the problem:

First of all, I get a date from the SQL that tells me the date of the last data we have, this field is FUltModif.

After the first load I have a table with the initial data and this is Geo.QVD, so I get the max FUltModif and then I get it with peek() function.

Tabla:

LOAD Date(max(Fecha_Modif),'DD/MM/YYYY') AS Fecha_Max //I have to do a Date() function because I was getting a number instead a date.

from $(Path_QVD)Geo.QVD

(qvd);

let vUltimaModif = peek('Fecha_Max',0,'Tabla'); //Debugging I can see that this returns me a date '12/12/2000'

DROP Table Tabla;

// First I load all the old data I have in my QVD

Georeferenciacion:

LOAD *

From $(Path_QVD)Geo.QVD

(qvd);

 

// And I want to concatenate the new data, the data with modification dates bigger than my last modificate date from my QVD

Concatenate

LOAD

     Cliente

    ,DepartamentoCod as DepCod

    ,CiudadCod        as CiuCod

    ,BarrioCod as BarrioCod

    ,CPostal

    ,Date(FUltModif,'DD/MM/YYYY') as FUltModif

    ,Date(FUltModif,'DD/MM/YYYY') as Fecha_Modif

    ,SitViviendaCod;

SQL select

     Cliente

     ,DepartamentoCod

     ,CiudadCod

     ,BarrioCod

     ,CPostal

     ,Convert(varchar,DataBaseTableX.FUltModif, 103) as FUltModif       // Convertion from varchar to Date DD/MM/YYYY

     ,SitViviendaCod

from DataBaseTableX

where FUltModif > #$(vUltimaModif)# 

;

What I´m doing wrong?? It seems like the where clause is comparing anything,

I suppose that is because they have different formats but I don´t know why.

Help me please, thank you.

Regards,

Chema.

1 Solution

Accepted Solutions
giakoum
Honored Contributor II

Re: Incremental load date format problem

I think SQL server date format should be YYYY/MM/DD in order to understand and compare.

2 Replies
giakoum
Honored Contributor II

Re: Incremental load date format problem

I think SQL server date format should be YYYY/MM/DD in order to understand and compare.

chematos
Valued Contributor II

Re: Incremental load date format problem

This little things are what makes me crazy sometimes !

May be they should change the format for 103 code...

103select convert(varchar, getdate(), 103)30/12/2006

If someone follows this thread to use it, they will need to eliminate the '#' symbols of

#$(vUltimaModif)#

Thank´s Ioannis!!