MYSQL Exporting values issue - excel

i'm new to MYSQL and i'm working on it through phpMyAdmin.
My issue is that i have imported a set of tables in after creating a database for them. I wrote some codes to obtain some values which are dates in a column and binary numbers in the second column, so i have 2 columns in total. Those date values are in the following format: dd-mm-yyyy
I want to export it to an Excel file and phpMyAdmin provides 2 exporting option which are:
CSV
CSV for MS Excel
For the first option, it exports "some" of the date values like this: ####### while there are other dates exported correctly but in this shape: dd/mm/yyyy !!
For the second option, it exports them all correctly with this date shape: dd/mm/yyyy, but all they are in one column like this:
2016-01-25;"0"
2016-01-25;"1"
Note: the imported tables are: UTF8_general_ci
I tried different formats, different things but i don't know, i couldn't have the values appearing correctly in 2 columns !!
Thanks in advance.

The hash marks ('#######') in Excel indicate that the value in that particular cell is too long to display as stated in #PerlDuck's comment. If you make the column wider you should be able to see your values. Note you can autofit any column to its values by double clicking the border between columns.
That said I think exporting to a standard CSV (comma separated value) should get you what you want. Modern editions of Excel handle raw CSV just as smoothly so I would go with that.

I don't use Excel but it looks like Excel doesn't use ';' as the column separator when you import the file. You can likely change that behaviour after you've selected the files.

Related

Xls export dispays large numbers as decimals

I am exporting a report in exel format, however, for customer identifiers that are more than 12 digits, the exel displays them as decimals eg 9876520220007 is displayed as 9.88E+12 or as 9.876520220007. This makes it very hard to verify data because the customer identifier is used to check if the records are correct. Any recommendations or links on how i can display the full number will be apreciated. Thanks
My data:
Link to sheet : here
How are you getting the data into excel? Is it via a csv?
In which case you can use the get data from file option which lets you specify the column type as text before excel messes with it.
You can also set the column format to text. This doesn't fix the ones that excel has already interpreted as a long number but any new ones you paste or type in will stay as text.
You can also put an apostrophe before the text in the cell which forces it to be text.
Thats the only one I can suggest up to now as I don't know how you are getting the data into excel.
Select the column and right-click to format cell, and set the decimal place to 0 that should do the trick. but I see you have different types of data in the column you might need to update it individually depending on the case
but I see the

Imported currency symbol in Excel cell $ is not 'auto' converted when I format as currency

I import a bank statement that has $ symbol in cell contents. I was expecting Excel to accommodate this when I format the cell as Currency (Dollar) and remove the $ from the value but have as the format displayed.
However this does not seem to be the case. I have to manually remove the symbol and then format as currency. I need to do this in order for a simple column sum to work.
Any ideas on the right 'process' to use to convert csv data so I don't have to do a find/replace?
Steps to reproduce:
Open CSV with column that has $ in each cell prefixing the value.
add column sum total to the bottom of the column
Convert column formatting to currency
Expected: Sum of Dollars in column in Currency format.
Actual: No value displayed in sum cell.
Excel 365 version 2101 on Windows 10
Thanks
In general, it is best to import csv files. Then you can inform Excel of the data type before it is processed (often incorrectly).
In O365, I suggest you start with Data=>Get&Transform=>from Text/CSV. If any columns seem to have been interpreted incorrectly, you can select Transform. Otherwise, just accept the defaults.
If the CSV file is updated, the query can also be updated.
The legacy wizard is also available, but is less flexible

convert “US Number Format To European” in Pivot table excel

My system setting is such all the numbers will be displayed US number format. I have a one off requirement where I need to convert the numbers to European Format. I have found a way to convert the numbers to European format using formula =SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(FIXED(B3,2,FALSE),".","$"),",","."),"$",",")
However when I tried create a pivot table the converted numbers are not getting aggregated and value is Zero. I know since my system setting is set up with US number format the numbers are not getting aggregated.To make it work everytime I have to change my system settings to European format and aggregate the data.
It would be of great help if any suggests me any alternative method to change the number format in pivot table.
Thanks,
Ganesh
You should change the formatting of the values, not convert your number value into a string.
E.g.: select your cells, press ctrl-1.

Reporting Services Format as number

I'm trying to format a column in reporting services to display a number with thousand separator and with commas. The expression I'm using is the following:
=Format(Fields!Price.Value, "#,##0.00")
It works great. Also if I use the expression:
=FormatNumber(Fields!Price.Value, 2, true, false, true)
works great too. The PROBLEM is when converting to excel. The column displays in excel as expected but the format of the cell is General instead of number with thousand separator. As a result users cannot apply formulas to the columns due to is treated as string (General formatting). I know I can convert in excel the column to Number format but I'd like that when converting to excel via reporting services the column just appears in number format.
Is it possible? Searching in google doesn't give me any clues.
Thanks in advance
The problem is that Format returns a string so that is what it is converting to in Excel.
To acheive what you want, simply format the item using the Format property. Click on the cell, open the property window and update the Format property to be #,##0.00
Even better, to make your application international, update the Language property of the report to be =User!Languageand then use N2 as your format property for the cell.

Consistent commas in Excel CSV

In Excel, let's say I have 5 columns, but not all of the time will a column have data.
How can I force it to give a static number of commas?
I end up having some rows like this (as I would like it):
Field1,field2,field3,field4,field5
field1,field2,,,
Then some rows like this:
field1,field2,field3,field4,field5,
field1,field2,
field1,field2,field3,field4,
you mean when exporting? That should happen by default. I tried it just now with Excel 2007 and all exported lines in the .csv-file had the same amount of commas. Those lines with fewer columns had extra commas at the end, just like in your example
Actual exported excel file:
hello;world;;;;
how;are;you;doing;;
hi;;;;;
welcome;to;;;;
the;jungle;;;;
some;line;with;lots;of;columns
The actual amount of commas is determined by the row with the most columns
So in this particular instance, there was a lot of copy pasting going on to create the file.
I finally opened a new worksheet, copied the entire document over, and created a CSV using that.
This resolved my problem.

Resources