DateDiff issue

More
10 years 7 months ago #6166 by ckelsoe
DateDiff issue was created by ckelsoe
I am trying to work through a way to calculate the unix timestamp value. This is what I have. It does not work due to date formatting. I have the date format set to M/D/YYYY as I was shown earlier today. Any ideas?




Here is the date format used:

Attachments:

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago - 10 years 7 months ago #6167 by admin
Replied by admin on topic Re: DateDiff issue
In order to load data into date/time/timestamp field it must be in YYYY-MM-DD HH:NN:SS.FFF format.

This is standard ODBC format

When data flows through the transformation the date format changes.

For example

Lookup -> format date

Lookup returns date field form the database in m/d/yyyy format
That means if you want to use default value(Set to Value) for lookup it must be in same format
12/1/2013

Date format function changes date into into YYYY-MM-DD HH:NN:SS.FFF
Incoming data for it in m/d/yyyy
This is format you use on the picture and it is correct
But if you want to use default value(Set to Value) for it it must be in YYYY-MM-DD HH:NN:SS.FFF format
So you should enter 1990-01-01 00:00:00.000

Eg Default value should be in the format as data is coming out of the function

Anyway in latest version we have introduced Date to Epoch and Epoch To Date Functions.

Give it try

Mike

Mike
ETL Architect
Attachments:
Last edit: 10 years 7 months ago by admin.
The following user(s) said Thank You: ckelsoe

Please Log in or Create an account to join the conversation.

More
10 years 7 months ago #6173 by ckelsoe
Replied by ckelsoe on topic Re: DateDiff issue
The new Date to Epoch works brilliantly. Thanks very much.

Please Log in or Create an account to join the conversation.