Access copying from datasheet yields extra quotes - ms-access

When I copy from a table or query in Microsoft Access datasheet and paste the data into a text file( notepad++, notepad etc. ) , extra quotes are inserted ( with the exception of EXCEL). Is there a setting I can change to fix that?

Related

Cannot change external column length

I have an SSIS package with a Data Flow that populates an Excel Destination from OLE DB Source. One of the columns in the DB has 500 characters length. On running the package, I get a warning:
Warning: 0x802092A7 at Data Flow Task, Excel Destination [38]: Truncation may occur due to inserting data from data flow column "DT_WSTR_Description" with a length of 500 to database column "F6" with a length of 255.
I see that F6 external column does have length of 255. When I change it to 500, it becomes 255 again. How can I solve it?
On the Properties window for the Excel Destination, set ValidateExternalMetadata to false. Then right-click on the Excel Destination, select Show Advanced Editor and go to the Input and Output Properties pane. Expand the Excel Destination Input node and then do the same for the External Columns folder. Go to the F6 column and under Common Properties you can change the length of the column now without it reverting back.

How to Keep SQL Formatting of Date and Quotes in Excel CSV?

I'm trying to update a massive SQL table with thousands of rows and the best method I've come up with is a script that allows me to import a CSV file.
My problem is that after I export the original CSV file from the SQL and then edit it in Excel to add new values, it removes the quotations around all the values. (which I can see when opening the CSV in a TXT editor)
I found a solution on here using visual basic in Excel and the formula:
for each v in range("A1:A1000") : v.value = CHR(34) & v.value & CHR(34) : next
The problem is that this formula auto-formats my date fields... so I'll be left with "8/20/2018 20:21:02 AM" when I need to have the dates in the standard SQL format: 2018-08-20 20:21:02.
Your problem is the way you open the file in excel
To open it properly, go to the data ribbon, choose import from text and on the wizard, make sure that the data type for the column is text
Another way to handle the issue is by a formula, on the converted datetime in excel format:
TEXT(cell-address, "yyyy-mm-dd hh:mm:ss")

ssrs 2008 r2 export to csv displays column all the time

In an SSRS 2008 R2 report, the users are going to export the data to: csv (comma delimited) and excel.
I am using the following to display if a column is visible or not:
=IIF(Mid(Globals!RenderFormat.Name,1,5)="EXCEL" AND First(Len(Fields!CustomerNumber.Value)) > 0,False,true)
I have set the DataElementOutput=Output for the textbox that displays the value.
I have left DataElementOutput=Auto for the textbox that contains the column header.
When exporting to csv (comma delimited) or excel, I basically want the column to be visible when there is data in the field and the column not to be visible when there is no data.
The code works for excel but the code does not work for comma delimited.
Thus, can you tell me what I can do so the column is not disaplyed when the data is exported to csv (comma delimited)?
You may attempt to do this with a continuation of statement accounting for the "CSV" output type.
=IIF( (Mid(Globals!RenderFormat.Name,1,5)="EXCEL" OR Mid(Globals!RenderFormat.Name,1,5)="CSV") AND First(Len(Fields!CustomerNumber.Value)) > 0,False,true)
Or a switch statement:
=Switch(Mid(Globals!RenderFormat.Name,1,5)="EXCEL" AND First(Len(Fields!CustomerNumber.Value)) > 0,False, Mid(Globals!RenderFormat.Name,1,5)="CSV" AND First(Len(Fields!CustomerNumber.Value)) > 0,False,true)
However....
The problem may be due to the nature of a csv file being a simpler format that cannot handle this in output. It depends on how SSRS handles the output if it is hard writing the output before the write operation. It may simply not work because of the limitations of the format of CSV. If this was the case you may be able to simple take the Excel output and save it to CSV either in code or a manual operation.

Import Errors from Excel to Access Using DoCmd.TransferSpreadsheet acImport Method

I'm getting some import errors when importing data from Excel in to Access.
I'm using the DoCmd.TransferSpreadsheet acImport, ... method to do the import.
The column of data that is failing contains a mixture of number-only entries and strings. It's the string entries that are failing to import.
Is there something I can do to the data in this column of the Excel spreadsheet to ensure it gets across to Access in its entirety?
While your Excel.Application code from your previous question is in there "counting rows" it could also inspect the cell for that column in the first data row. If it is numeric, your code could glue an apostrophe (') at the beginning to force it to be a label, and then save the Excel file. Then, when Access' TransferSpreadsheet method looks at the first row it will decide that the column is text, not numeric.
I found something approaching a workaround:
Sort your offending column in Excel so that your numerics appear as the top-most group and your alphanumerics are at the bottom.
Highlight all your numerics now grouped in the column
Go to Data > Text to Columns
Wizard Page 1: Select "Delimited"
Wizard Page 2: Tick "Tab"
Wizard Page 3: Select "Text" and finish
Numbers will be stored as text with the leading apostrophe and should import ok in Access
Source
There's probably a better way of doing this though if anyone wants to chip-in.

SSIS Data Flow Conversion of Float to NVarchar importing null values

I am trying to import an Excel 2007 spreadsheet into a staging table and I am encountering issues with some of the column types. Some of my columns have a combination of numeric and text values i.e. A column called Customer No can have numeric values such as 1234, 32432433, or text values i.e. A1000, ACC101TEXT. When I import my spreadsheet, the values with text in them are returning null whereas the numeric values are being imported properly. Moreover, the last row has a text description in this column that I need, however, after the import, this row value is null. Is there anything I can do to rectify the situation and import the spreadsheet as is? I've tried using data conversions from the data flow transformation, however, that is still not working. Please note, I cannot change or format the excel spreadsheet. Any help would be greatly appreciated.
You need to use the Advanced Editor to tell the excel source the column is a Unicode String, not a numeric. That is why alphanumeric fields are null.
Right-click on the Excel Source and choose advanced editor
Choose the fourth tab "Input and Output Properties"
Choose the column in question under the "Output Columns" and change the source to Unicode
That should fix your problem.