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.
Related
I am exporting reports as XLS files from Salesforce. These reports have dates that I want to be able to manipulate in Excel but... Excel doesn't recognize them as dates.
The format outputted by Salesforce right now is m/d/yyyy (ie: 8/18/2022). When I go in Excel and change the format to date... the data is not recognized as a date.
It seems the only thing that Excel can consume are dates configured as yyyy-mm-dd.
I tried to play with Excel formatting date form with no luck.Excel doesn't recognize the Salesforce format, or does not propose anything similar to it
Is there a setting in Salesforce or in Excel that I need to adjust so that both apps can generate, and digest the same date configs?
I want to run these reports weekly so whatever requires the less Excel gymnastic will be the best solution (Google Docs for instance recognize dates as Salesforce spits them... - but I can't use GDocs at work).
You should use PowerQuery to import the data to Excel.
In PowerQuery change the Column-Type USING LOCAL
Select Date and English (United States)
Voila!
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.
Surely someone before me has needed to produce a year, month, day in a single field for a CSV that "just works" in popular versions of Microsoft Excel? I want only a date, no timestamp, though I suppose I could include 00:00 or something like that if I absolutely had to.
Panagiotis Kanavos points out that "Excel can only import it and try to guess whether the text values correspond to a certain type, using the user's locale settings." My question is about what format will cause Excel to guess correctly in the US and Europe, and ideally everywhere else.
If it's impossible or unreliable to do this in CSV, I will accept a link to using some zipped XML format or something that Excel and other spreadsheets accept universally instead of CSV.
This is NOT a duplicate of of the following:
Best timestamp format for CSV/Excel? because I want it without a timestamp.
What are the "standard unambiguous date" formats? because I need CSV specifically for Excel to read.
Excel CSV date format because I need Excel import from CSV, not export.
Read Date Format in PHP EXCEL because I need Microsoft Excel, not PHP Excel.
Excel will recognize YYYY-MM-DD as a global standard.
Cartoon from: https://www.xkcd.com/1179/
The difficulty with answering your question is that to test the proposed answer, the format must be tested in "all popular versions" of Excel
I have several versions of Excel and in my testing this:
worked in all my versions (English-US Locale)
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.
i have problem with excel changing the date format so it fits regional settings.
my problem is:
i am creating tool in which user chose which *.csv file to import and work with. While tool is on user side i can't rely on regional setting - tool have to work for all.
Problem is that excel automatically change date format to fits regional setting and therefore it is wrong or i can't parse it with static delimiter (like '/').
I know the format in which the date is written in the csv file (yyyy-mm-dd or dd/mm/yy) and i would like to read that date as a text so i can use DateSerial to create correct date.
Is there any way to read csv only as text and prevent excel from changing it to date (based on user regional settings) automatically ?
Thank you.
When importing, specify the column as text.
Or, put an apostrophe at the start of each date value. This is the "this is a text value, don't reformat it" symbol.
example
123,'12/29/1999,blah blah