Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a file that is automatically generated and replaced everyday by a file with same file name except the date changes.
Example = NEW_AGENT_2016.09.22.TXT
I only need to pull current days file. Is there a way to do this without going in and updating the load statement everyday with the new file name?
LOAD [Agent Code],
[Agent Name],
[Curr Rep Type]
FROM
[\\FILE_LOCATION\NEW_AGENT_2016.09.22.TXT]
(txt, utf8, embedded labels, delimiter is ',', msq);
May be like this:
LET vDate = Date(Today(), 'YYYY.MM.DD');
LOAD [Agent Code],
[Agent Name],
[Curr Rep Type]
FROM
[\\FILE_LOCATION\NEW_AGENT_$(vDate).TXT]
(txt, utf8, embedded labels, delimiter is ',', msq);
May be like this:
LET vDate = Date(Today(), 'YYYY.MM.DD');
LOAD [Agent Code],
[Agent Name],
[Curr Rep Type]
FROM
[\\FILE_LOCATION\NEW_AGENT_$(vDate).TXT]
(txt, utf8, embedded labels, delimiter is ',', msq);
you can define a variable
Let vtoday=date(today(),'YYYY.MM.DD');
and the use
load
..
FROM
[\\FILE_LOCATION\NEW_AGENT_$(vtoday).TXT]
(txt, utf8, embedded labels, delimiter is ',', msq);