Skip to content
+1-888-319-3663

COMMUNITY FORUM

convert int64 to date

John G asked 5 years ago
We have a field in our data source for transaction date YYYYMMDD where the record is stored as INT64.  How can we convert the int64 field to a date ? mm/dd/yyyy for GP?
 
Answers
Ethan Sorenson Staff answered 5 years ago
Hello John,
There are two ways to convert this date to the format expected by GP.
The first way uses SmartConnect’s built-in date column which can be found in your destination by going to Additional Columns > Columns > Date Column. The SmartConnect Manual breaks down the different format strings that can be entered in to create a new date type.
http://www.eonesolutions.com/Manuals/SmartConnect/SmartConnect%202016/?page=sc_date_formatting
 
The second approach is to create a calculated column by going to Additional Columns > Columns> Calculated. By default the code used is VB.Net, but you can change it to use C#. 
 
Ethan
John G replied 5 years ago

We have a field that INT64 which is storing 20150701. We need to be able to convert this to a date format to import to GP. We cannot use the built-in date as it is not stored as a date. We are unsure on how to use vb.net to change the format.

Ethan Sorenson Staff replied 5 years ago

Hi John,
You can set your own date format in the date column by going to manage formats > Type in a name for the format and click the (+) button. Then click on the box to the right of your new entry and type in yyyyMMdd. Then use that as your source format and select the format you want for the destination.

Ethan

John G replied 5 years ago

I just tried that. Received a message: 20150701 could not be converted to a date: String was not recognized as a valid datetime. Our source is another database where the field is stored as INT64 not date.


If you would like to submit an answer or comment, please sign in to the eOne portal.