Importing Excel into SQL2005, issue with currency symbols and text in a number field - sql

I have a field in my Excel as follows
€250
€240
Free
....
In my SQL2005 Preview this looks as follows
250
240
(Blank)
So it doesnt like Symbols and Text in this column altho it is going to a varchar column.
Any Ideas ?

Check whether the € is stored in your excel file as part of the value of a cell or as formatting.
I was trying to reproduce your problem, and when I entered €250 into a cell, when I later selected the cell to check the value, it was 250 (Excel had decided that I was trying to give the cell a numerical value, formatted as currency)
If that isn't the problem, trying using nchar as your column type rather than varchar. nchar allows a wider range of symbols.

Related

OpenRefine - Converting text column with numbers to numeric type

I created an Age column based on the difference between 2 date columns. Initially I was able to create the Age facet without any issues.
But on reopening the project I am unable to create the Age facet. It looks like the Age column has somehow turned into a text column. And I have to keep converting all cells to numeric before being able to facet by Age each time I reopen the project.
Another issue (is this the cause?) with this column is I noticed wrong values in some Age cells and tried to update the value to leave it blank (i.e. age unknown) but having converted all cells in them column to Numeric the operation wasn't allowed. I am not sure if somewhere I left a cell as blank (text) space while making these corrections. If this is the reason for refine to treat the column as text how do I identify those particular cells and then set them to unknown numeric or null values?
Thanks.

Column values Coming as Exponent in Excel from SQL Server

I was working on SQL Server 14, one of the column had relatively huge value. When I copied the data from SQL Server and posted it in Excel, the value got changed to Exponent power. I don't want that, I want the original value as it is in excel.
What needs to be done in the query?
P.S: The column is of type Varchar and I cannot change the structure of the table.
Thanks in Advance.
Just format the excel cell to text:
You can see on the picture above same value pasted in cell formatted as general and in a cell formatted as Text.

Setting an specific format for an Excel Column with VBA

I am currently working with a macro that gathers data (code identifier) from a source with a print screen and pastes it to excel.
Problem is, every time a data point (identifier) is a value with an "E" included, excel interprets as a scientific notation and changes the original value.
Is there a way to make excel set the column in which I have those values to text before pasting, or for it to paste the whole content as text automatically?
Thanks for the help.

Excel to SQL table field value appending with 0

I loaded an Excel file into an SQL table. The Excel file, one field consists of VARCHAR data (of data type general). When loaded into an SQL table, some of these values are prefixed with zero.
Example: in the Excel file it is 1081999 the same value become 01081999 in the SQL table.
What might be the reason for this ?
Excel will hide leading 0's as it identifies the fields content as a number and displays it as such. I would assume that the excel worksheet does indeed contain these leading 0's and they are simply not shown by Excel. If you change the type of the column from General to Text do they show up??
As a side note, if these are indeed numbers you should be storing them in a numeric datatype in the database...

PHP EXCEL Number Format

I'm using a PHPExcel Library to Export my database to excel...
I have a value 200010058502 to be exported but it will appear as 2.0001E+11 in the excel file
Any idea how to format this to make the value the same in my database
My PHPExcel code to fetch value from the database:
$objPHPExcel->getActiveSheet()->SetCellValue("J".$xlsRow,$row['acct_no']);
Thank You in advance
This most likely is an Excel display issue, not a PHP issue.
To verify that the number is imported correctly, highlight the cell and check the status bar. It should show the entire number, and not in scientific notation. If it doesn't, ignore the rest of my answer.
Increase the width of your Excel cell to be more than 11 digits wide. Excel will automatically convert numbers to scientific notation that are too large to physically fit in the display. If it still is in scientific notation, change the formatting of the cell (cell->format->number) to show a number with zero decimal places.