Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts, I'm trying to load the last 12 months info's and this is not working.
Before this code I have a table "PERIODOS" where I have the periods of my info
Here is the code
SET VUELTAS = 12;
FOR i = 0 TO $(VUELTAS)
LET vPeriodosBuscados = date(PEEK('ULT_PERIODO', i, 'PERIODOS'),'YYYYMM');
SET vFileName = '[lib://DataFiles/DETALLE_ORDENES_(vPeriodosBuscados).qvd]';
LET vFileSize = FileSize($(vNombreArchivo));
IF NOT IsNull(vFileSize) THEN
ORDENES_PERIODO:
LOAD
ID_ORDEN,
ID_CLIENTE,
ID_EMPLEADO,
TRANSPORTE,
AÑO,
MES,
DIA,
FECHA,
COUNT_ID_PRODUCTO_ORD,
ID_REPARTO,
PERIODO,
ID_PRODUCTO,
DESCUENTO,
NRO_LINEA,
COUNT_PRODUCTO_DET,
CANTIDAD,
PRECIO_UNINTARIO,
MONTO_DE_VENTA
FROM [lib://DataFiles/DETALLE_ORDENES_$(vPeriodosBuscados).qvd]
(qvd);
ENDIF
NEXT
The info doesn't load and the vPeriodosBuscados have the right info when I use the debbug
There also looks to be a dollar sign missing:
SET vFileName = '[lib://DataFiles/DETALLE_ORDENES_$(vPeriodosBuscados).qvd]';
Your code doesn't seem to be setting $(vNombreArchivo) - what's in that variable? That is the one you're testing for filesize...
Sorry, it's the same vFileName variable, when I posted I change some of the names to English and I forgot that.
I use the vFileName variable.
LET vFileSize = FileSize($(vFileName));
There also looks to be a dollar sign missing:
SET vFileName = '[lib://DataFiles/DETALLE_ORDENES_$(vPeriodosBuscados).qvd]';