dataTime datatype converted to string in importing excel file to protege using Celfie Plugin, - excel

I am working on Protege 5.0 with the plugin Celfie. I have imported an excel sheet which has a column Start_Time (datatype dateTime). When i import the excel sheet into protege, it converts the rows from dateTime format to a string or some other data type. I want to use that column for a data property having the data type DateTime.
I have attached screenshots of both my excel sheet and the celfie tab. Any help would be appreciated.
Celfie Plugin Tab snapshot
Excel Sheet snapshot

The issue is actually a formatting issue in Protege. In Excel, date times are stored as floats, with the integer representing the date and the decimals representing the time.
39448 is 01/01/2008 (https://support.office.com/en-us/article/DATEVALUE-function-df8b07d4-7761-4a93-bc33-b7471bbff252); since the results you're getting in Protege are similar, those seem to be the raw date time values.
You need to convert them in Protege, either by using an informat when you pull them from Excel, or by formatting them in Protege in the same manner that Excel would.

Related

PowerApps -> Excel

I have a PowerApp which is connected to Excel (OneDrive Business).
I want to write some Data to a table.
The problem are the DateTime.
If I choose for example "07.03.2021 01:00" in the DatePicker/TimePicker the "correct?" format is created für the Update-Field (I didn't change anything in the Update Formula).
But in Excel is a funny number written: 1615075200000
I tryed to format the cells in Excel as Datetime, number, text ... before writing to the cell/table nothing helps.
For some times (see ID's 1-8 in Excel screenshot) there was a datetime wrote, I don't know why.
What I have to change that the right datetime will be written to Excel, and the datetime should be displayed in excel as "07.03.2021 01:00"
I believe it's excel cells date-time format.
I am doing exactly as your example and the date-time updated in excel with the correct format.
Please check the below screenshots
Can you verify the Excel sheet date format?

Oracle SQL DB import to Excel issues with date formats

I have a excel file that automatically imports data from an Oracle DB into the sheet. Everything works fine, but date formatting is wrong. In the Oracle DB, the format is 01-JAN-2016. But when it exports to Excel, the format suddenly changes to 1/1/2016.
Is there a good solution to this? Setting the cell format beforehand doesn't work. Once the data is imported, Excel automatically switches format to Date. I have tried a lot but can not solve this issue so I am wondering if any of you have ideas as to what to do. Thanks.
The date isn't stored in "01-JAN-2016" format, that's just a representation of the underlying date value.
The recordset contains the data, not its representation. Format the column with a NumberFormat like dd-mmm-yyyy, and 2016/01/01 will look like 01-JAN-2016.

Dynamically Creating Excel table through SSIS

Using Execute SQL Task in SSIS - created Excel file- contains multiple columns and different data types.The issue here is INT/Money columns are displaying as a text columns in Excel even though excel table is created with Int/Money datatype
I have tried to used double precision,CY datatypes but nothing worked out.
CREATE TABLE `Employer` (
`MEMBERSHIP NUMBER` VARCHAR(30),
`RETIREE #` VARCHAR(12),
`COPID` CHAR(6),
`PERSON LAST NAME` VARCHAR(150),
`FIRST NAME` VARCHAR(150),
`RETIREE PLAN` CHAR(15),
`PLAN NAME` CHAR(200),
`BILL GROUP` INT,
`BRANCH ID` CHAR(3),
`CONTRACT NUMBER` CHAR(5),
`PBP` CHAR(3),
`BRANCH NAME` VARCHAR(150),
`COVERAGE MONTH` DATE,
`DUE AMOUNT` INT
)
Expected output should be in input datatype format.
OLE DB data types and Excel
Even if you can create Tables in Excel using OLE DB commands, excel files are not databases, where columns have data types. The OLE DB provider read only tabular data and need to specify a data type for each column. For this reason, you must specify columns data types when handling Excel, even if excel has the ability of storing multiple data types within the same column.
One of the disadvantages of using OLE DB provider to read Excel is that if a column contains mixed data types, it only reads the dominant data types and convert all remaining data types to NULL.
Importing data from Excel having Mixed Data Types in a column (SSIS)
Mixed data types in Excel column
Excel Number Format property
On the other hand there are a Cell property in excel called Number Format which is used to change the way values are shown in Excel. You can use this property to show values as Currency.
Format numbers as currency
HOW TO DISPLAY NUMBERS IN EXCEL 2010 AS CURRENCY
Solution
You can use two approaches to solve the issue:
(1) Changes Column Number Format using Script Task
You can add a Script Task and change the entire column Number Format using Interop.Excel.dll assembly.
Format an Excel column (or cell) as Text in C#?
Format Entire Excel Column Using C#
(2) Create an Excel template file
You can create an Excel file and change the columns Number Format as needed and use this file as template. You can copy the file the the destination directory, then perform data import phase.
Quick Start: Format numbers in a worksheet

Excel to Access date error in formatting

I am having an issue with a program. The macro in Access imports an Excel file, then it appends an already created table with the imported data, and runs a check after to make sure that the table was appended correctly.
I have tried for hours to figure out why my imported tables are not being appended. I know that this is a formatting issue. There are six columns in my Excel table. The first three columns have Text Data Type. The fourth has Number Data Type. These are fine since the field properties match exactly for the imported table and the already existing table.
So my issue is with the last two columns. The last two columns in the existing table in Access have Date/Time Data Type. The format of these columns as shown in Field Properties is m/d/yy;# (I'm not sure what this means and an explanation of this might be helpful)
The imported table has Date/Time Data Type with format m/d/yyyy. I have tried changing the format in Excel to m/d/yy and m/d/yy;#. Both of which got the format to show correctly in Excel, just as it does in Access for the correct table. But when I import it does not keep this formatting.
The check does not register the rows with new dates and the table does not get appended. I am looking for an easy fix in Excel to change my data's formatting as there are 17 separate macros that I have to run each month.

Max of DateTime (custom) field not recognized in PivotTable

I have some fairly simple raw data where the format of column LastUsageTime is custom (yyyy-mm-dd hh:mm:ss):
And a PivotTable:
.
The LastUsageTime column is a MAX function (I simply want to display the dates, not count them). The problem is Excel doesn't understand the custom DateTime format of the raw data LastUsageTime for some reason. It puts 1900-01-00 everywhere. However, if I copy the text of LastUsageTime, paste it to NotePad, then Copy/Paste it back to Excel, it works fine!
However, the raw data is sourced from an external XML file, so when I click refresh, it gets messed up again.
How can I fix this?
I think you need to convert the raw data LastUsageTime from string to a date/time value (as Excel does for you by coercion with the copy/paste). Perhaps:
=DATEVALUE(E2)+TIMEVALUE(E2)

Resources