HomeForum
Welcome, Guest

File name FORMAT Date?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: File name FORMAT Date?

File name FORMAT Date? 1 year, 1 month ago #2603

  • Charles
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 0
I have a file that is being downloaded in this format - HUUU10X06232008.csv with the date in the file name MMDDYYYY.
I need to be able to pull the file for the current day using a filter in the import node.
Is there an easy command like FormatDate that can be used?

Currently I am pulling from system date YYYYMMDD.

Thanks in advance for your help!!

Re: File name FORMAT Date? 1 year, 1 month ago #2604

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2182
  • Karma: 12
Use

c:\whateverpath\HUUU10X{FormatDateTime('MMDDYYYY',now)}.csv

FormatDateTime formats the TDateTime value given by DateTime using the format given by Format. See the table below for information about the supported format strings.

From documentation

Note:
Only one {} pair is allowed.

GETSYSTEMVARIABLE('SYSTEM_DATE') will return current date in ‘YYYYMMDDHHNNSS’ format

If we want only part of date we can use LeftString(String,Count):String for example

LeftString(GETSYSTEMVARIABLE('SYSTEM_DATE'),8) will return only date part.

Now more complicated example for loading yesterday’s data;

LeftString(DecDateS(GETSYSTEMVARIABLE('SYSTEM_DATE'),'YYYYMMDDHHNNSS', 'DAY',1),8)

Note:

For complete reference of available functions consult chapter 16.
  • Page:
  • 1
Time to create page: 0.16 seconds

Testimonials

"I've been very impressed with Advanced ETL Processor. It is extremely powerful and can validate and transform practically any data set you work with."

David Gig,
Director of Information Technology

User Login

You only need to log in or register to use our support forum



Our customers

BP

BBC

HSBC


Databases we work with

Go to top