- Posts: 568
- Thank you received: 72
Date Formatting Conditioning
- bruce.gibbins
- Topic Author
- Offline
- Platinum Member
-
Less
More
4 years 7 months ago #18971
by bruce.gibbins
Date Formatting Conditioning was created by bruce.gibbins
Looking for a concise and clean way of doing this (AETL v6.3.4.4 x64)
Inbound CSV file has some dates in one of three formats
1) NULL
2) MM/DD/YYYY HH:NN:SS
3) M/DD/YYYY H:NN:SS
Writer will need to cleanup to
1) NULL
2) DD/MM/YYYY HH:NN:SS
Meaning that if it comes in as NULL then goes out as NULL, if one of the other formats occurs then it is formatted to DD/MM/YYYY HH:NN:SS all other cases should result in an error of some sort.
But what I have noticed is that if the Inbound Date field is NULL (or Empty) the DateFormatter treats the date as start of the Epoch and overrides the initial NULL value.
Inbound CSV file has some dates in one of three formats
1) NULL
2) MM/DD/YYYY HH:NN:SS
3) M/DD/YYYY H:NN:SS
Writer will need to cleanup to
1) NULL
2) DD/MM/YYYY HH:NN:SS
Meaning that if it comes in as NULL then goes out as NULL, if one of the other formats occurs then it is formatted to DD/MM/YYYY HH:NN:SS all other cases should result in an error of some sort.
But what I have noticed is that if the Inbound Date field is NULL (or Empty) the DateFormatter treats the date as start of the Epoch and overrides the initial NULL value.
Please Log in or Create an account to join the conversation.
- Peter.Jonson
-
- Offline
- Platinum Member
-
4 years 7 months ago #18973
by Peter.Jonson
Peter Jonson
ETL Developer
Replied by Peter.Jonson on topic Date Formatting Conditioning
Hello
I have run some tests and noticed when the data is null it works correctly but when it has spaces only it returns 1899-ETC
Please put trim function before the date format.
I have run some tests and noticed when the data is null it works correctly but when it has spaces only it returns 1899-ETC
Please put trim function before the date format.
Peter Jonson
ETL Developer
The following user(s) said Thank You: bruce.gibbins
Please Log in or Create an account to join the conversation.