The mysql table has a DATETIME field. I want to INSERT a new row into this field using the cell data from the Excel worksheet. But I cannot use the datetime formatted cell value in a INSERT INTO query. How can I implement this?
Clarifying how you are using VBA would be helpful, but assuming that you are using VBA primarily to bring the data up to MySQL, you can handle a lot of your formatting right in your Excel workbook. For DATE type data,
=TEXT([the data],"YYYYMMDD")
is effective.
For DATETIME type data,
=TEXT([the data],"YYYYMMDDHHMMSS")
gets interpreted correctly at import by MySQL.
Hope that helps!
You could create a custom format that represents the datetime in the correct way.
Related
There is a date column used in OBIEE analysis. That column is declared as 'date' datatype in Oracle table, type in rpd is also 'DATE'. However, when exported to Excel, Excel is adding time values to the end of date part of this column. Here is a simple analysis:
The same analysis when exported into Excel:
As you can see, it is adding '5:00:00' to the end of '11.05.2022'. My guess is it is adding timezone values by default, which is the following in our OBIEE:
How can we prevent Excel from adding unnecessary values? Should we change settings in instanceconfig.xml file to use formatted value using 'UseFormattedValue' parameter? Or is there any simpler way to do this?
UseFormattedValue is the way to go because your problem isn't the Oracle side, but rather Microsoft trying to be "smart" in their interpretation in Excel.
https://docs.oracle.com/middleware/bi12214/biee/BIESG/GUID-FF6954BA-2DE0-4422-BA58-05F32936F4FF.htm#BIESG9196
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?
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.
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.
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)