CRM 2011 Import Wizard changing date format? - dynamics-crm-2011

I have been trying to import contacts from a .csv file into CRM 2011.
All seems well until I look at the failures and see any contacts I am trying to import with a date of birth are failing.
I have checked both my settings and the system settings and they are both set to English (UK). The .csv file originally had the dob in the following format dd/mm/yyyy but after the import it looks like this has been changed to mm/dd/yyyy which is why it is failing (seems impossible but I have tried this a number of times).
Any ideas how I can ensure that the date format does not change so that I can successfully import my contacts?

I haven't tried it but i think it may work:
Open the csv file in Excel
Set the format of the DOB column to your preferred date format.
Save the file in Excel 2003 xml format.
Import the new xml file

Related

Python giving me datetime Value Error from CSV

I have one Python file that helps me pull and organize datetime data from a server into a pandas DataFrame, and then export out into a nice and usable CSV. My second Python script needs to read the CSV and analyze the data. If I do not touch the exported CSV, the analysis can read the CSV and runs smoothly. However, as soon as I try to merge a few CSV files together with Excel/other spreadsheet software, I get a datetime error
ValueError("time data %r does not match format %r" %
ValueError: time data '2019-12-26 23:00' does not match format '%Y-%m-%d %H:%M:%S'
Even though, it is a direct copy/paste and still saved as a CSV. Any guru can provide some insight on this matter?
Pretty sure this is an Excel issue, not a Python problem.
If you load a .csv that has timestamp strings into Excel, Excel recognizes the datetimes - and formats them. This format seems to default to MM.DD.YYYY hh:mm (the date component might be different depending on your locale):
If you save the file in Excel, the seconds are removed in the .csv!
The only procedure that seems to reliably prevent this behavior is to set a specific date/time format for the respective column, e.g. DD.MM.YYYY hh:mm:ss. AFAIK, You'll have to do this manually for each workbook
Or perhaps write a macro. In older Excel versions, I had a PERSONAL.XLSB for that; should still work with newer versions, you'll have to put it in C:\Users\[username]\AppData\Roaming\Microsoft\Excel\XLSTART
you can use .xlsx format instead of .csv, presumably you won't loose format information there
I see from the error that not all your CSV files have the same time format.
Some on them are in [hour:minute] and some in [hour:minute:second].
ValueError: time data '2019-12-26 23:00' does not match format '%Y-%m-%d %H:%M:%S'
Make sure that datetime fields in all of your CSV matched the same format.

Excel PowerQuery - Best way to import SQL Server Logs with correct DateTime conversion?

In SQL Server I often check error logs directly in SSMS, but when I export them as CSV files, the DateTime component is converted from Australian to US format.
This is what it shows - in AUS format:
But this is how it's imported into Excel - US format:
I've tried to import the LOG file using PowerQuery, but it doesn't detect the column is a DateTime column, and when I try and convert it, I get Error.
I thought PowerQuery was "smart" to know the data types of columns. If I have to Add Columns by stripping the text into its date components, I might as well have just done it in the vanilla File Open CSV wizard.
Thanks
In Power query, right click on the column and select
Change Type
Using Locale
Pick Date/Time and English(Australia)
It will then be converted into a "real" date/time.
Of course, it will be displayed in PQ in accordance with your Windows Regional Settings short-date format.
Once you load it into Excel, you can change the cell numberformat to display it in the date/time format of your choice.

Importing Dates into Access 2013

What types of date values will access recognize when you are importing? I have a csv file that has a date field that Excel recognizes but Access does not (data conversion error).
When you are importing dates, the import form has a section which lets you define what format your dates are in. There is a chance your regional settings are also in play, so make sure the form matches your data. Remember that UK uses dd/mm/yyyy by default and the USA uses mm/dd/yyyy format.

Microsoft excel display generated CSV field wrong

I am not sure I can ask this below question here.
I generated a CSV file. Each CSV line contains a field in this format {digits}-{digits} such as 4-48, 5-62, ...
When I open the CSV file using Microsoft Excel. I got Apr-48 ( for 4-48) and May-62 (for 5-62)
Anyone has any ideas? I expected what I can see in excel is 4-48, 5-62. I already tried to format the column already. I used general format OR Text format but It didn't work.
Thank you!
You can import the csv into Excel from Data > From Text then go through the wizard and import the columns as text (on step 3 of the wizard) and then excel should not try and be "clever" and covert them to a date.

CSV converting date from US to UK format only changes some, not all

I have a CSV file that contains a few date columns. It was created with the US format of dd/mm/yyyy. I need to switch those dates to the UK dd/mm/yyyy. Saving the file seems well and good. But when I reopen the file many of the dates appear without the zeros if they had one as the first digit. An example:
saved as - 03/03/2012
when re-opened - 3/3/2012
I'm using Excel 2007 and saved from xlsx to all possible CSV options (mac, windows, ms-dos..)
Anyone know why this is happening, or more importantly a solution?
For windows users, go to the control panel, pick regional and language options and pick the date format you want. In windows XP, the option for dd/mm/YYYY format only appears if you pick "English (United Kingdom)". I have not tried the export, but this fixed the import of a csv file.

Resources