Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Quiero poner la fecha que trae el nombre del archivo en una variable, pero me da el siguiente error
SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
load *,
Date(Right($(file),10)) as Fecha_Carga
from $(file)(txt, codepage is 1252, no labels, delimiter is ';', msq) ;
next file
========================= ERROR =========================
Error in expression:
')' expected
load *,
Date(Right(C:\Users\steam\Desktop\ENEL\GICO\Analisis Emidoc AC 10-2017.XLSX,10)) as Fecha_Carga
from C:\Users\steam\Desktop\ENEL\GICO\Analisis Emidoc AC 10-2017.XLSX(txt, codepage is 1252, no labels, delimiter is ';', msq)
SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
load *,
Date(Right('$(file)',10)) as Fecha_Carga
from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;
next file
SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
load *,
Date(Right('$(file)',10)) as Fecha_Carga
from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;
next file
Muchisimas gracias !
Podria abusar un poco mas de tus conocimientos y hacer que me carge en fecha_carga lo que esta despues de AC osea el 10-2017 como mes y como año?
SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
load *,
Date(Right('$(file)',10)) as Fecha_Carga
from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;
next file
¿podría explicar mejor?
eu tenho
SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
load *,
Date(Right('$(file)',10)) as Fecha_Carga
from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;
next file
mais Fecha_Carga esta vazio entao como eu posso fazer pra que ele nao este vazio, eu acho que eu estou fazendo Date(Right('$(file)',10)) ruim
Certo,
O que vc espera receber em "RIGHT('$(file)', 10)" ???
eu espero receber 10-2017 do
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
Tente fazer o seguinte:
DATE(DATE#(YourDataFieldName, 'MM-YYYY'),'MM-YYYY')
SET Carpeta="C:\Users\steam\Desktop\ENEL\GICO";
for each file in filelist ('$(Carpeta)\Analisis Emidoc AC 10-2017.XLSX')
load *,
DATE(DATE#('$(file)', 'MM-YYYY'),'MM-YYYY') as Fecha_Carga
from '$(file)' (txt, codepage is 1252, no labels, delimiter is ';', msq) ;
next file
ainda tenho Fecha_Carga vazio