How do you import date fields from excel?

Not applicable

I've been sifting through the Importing articles on the wiki, and trying various settings, but I'm still not having any luck. I want to import a number of tasts and set the Opened date field.

In excel, I've tried using various date formats, the General cell format, and the apostrophe ' prefix in the cell. Whenever I run the import it sets it to a random date like year 0099 AD etc.

29 REPLIES 29

Going to hold off on that for a bit then. We are looking at implementing LDAP Integration which I hope eliminates the need for this transform map we are using today.


rgarland
Kilo Contributor

Something else I just noticed in your error. It is saying 'Unable to format 01/09/2012...." In your spreadsheet, you need to make sure your date field is formatted as 'mm-dd-yyyy' and not 'mm/dd/yyyy'. We did that with a Custom Category/Type format.


bburdick
Mega Guru

Ugh! That was it. Some times it pays to be literal. Thanks rgarland. All I had to do was write a little transform script so I could convert the '/' to a '-' and modify the file type format and it worked fine. The way I get the field doesn't allow me to request they use '-'. But with the little transform script it works sweet!!



var month = source.u_hire_date.split('/')[0];
var day = source.u_hire_date.split('/')[1];
var year = source.u_hire_date.split('/')[2];

var newDate = month + '-' + day + '-' + year;
answer = newDate;


Works like a charm. And thanks for your help and time.


Thanks rgarland and Benjamin. This works great. I used it today for two dates that we were trying to import.


Thanks BBurdick and Rick


This helped a lot,


it worked..



Regards


Vaibhav