8 Replies Latest reply: Aug 30, 2013 5:44 AM by test test RSS

    Update QVD-file with only latest values from DB

      Hello,

       

      I have a database with price records. Every day, lets say 20 records are added. The database itself is over 3 million records big.

       

      I dont want to reload these costs every time I reload my script. Is it possible to reload only the records of the past 2 days? or just the new ones?

       

      My current code looks like this:

       

      [CostTemp]:
      LOAD
        crec1_ref as [KeyPart],
        Date(Date#(Mid(9000000-num(crec1_date),2),'YYMMDD'), 'DD-MM-YYYY') as [CostDate],
          if(creccost3 = 0,creccost1, creccost2) as [BewerkingsKosten],
          if(creccost3 = 0,creccost2, creccost3) as [MateriaalKosten],
          if(creccost3 = 0,0, creccost1) as [MachineKosten],
          crectotal_cost as [TotaleKosten];
      SQL SELECT
        crec1_co_site,
        crec1_rec_type,
        crec1_ref,
        crec1_date,
        creccost1,
        creccost2,
        creccost3,
        crectotal_cost
      FROM CREC_DATA
      WHERE crec1_co_site = '$(Company)'
      AND crec1_rec_type = 1
      AND crec1_date < 7918769
      AND crectotal_cost <> 0;
      STORE [CostTemp] INTO "DATA_NEW/PartCosts.QVD";
      DROP TABLE [CostTemp];