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.
Related
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?
Regarding datetime values, is there an encoding that I can select from
SQL Developer that when I export to Excel it is formatted as datetime?.
I tried UTF-8 & UTF8. What appeared was,
01/01/85 12:00:00.000000000 AM
This isn't filterable from the filter drop down in excel.
In Microsoft's SSMS, I could select ANSI and the datetimes values would appear fine.
But SQL Developer doesn't seem to have this option (ANSI).
Current work around that I do is to extract in Excel the value into another column with the date formulas (date, year, month, day).
Edit
Exporting as datetime that excel can interpret, oracle can actually do it as well.
But it must be exported as csv.
It is the same for Microsoft's SSMS.
The oracle excel export that I was using had results that were in 1 sheet and the sql executed in the another.
No, we don't format the cells when we create the Excel file. You'll need to do that in Excel when you open it.
As it often happens there is a lot of questions similar to this one, but none of the ones I found gives me an answer to the issue I am having.
I am trying to import columns with Timestamp from Excel to SQL DEVELOPER. In the Picture 1 you can see formatting of the dates in excel. Format RRRR-MM-DD GG:MM:SS is Polish equivalent of English YYYY-MM-DD HH:MM:SS.
Picture 2 shows my NLS settings in SQL Developer and Picture 3 shows what i am getting while trying to transfer the data from excel. It looks like SQL somehow reads the format of the date on its own way? Or maybe excel stores the data in other way than its displayed while opening the workbook? Any ideas how to correct this?
Presentation of my data arrangements
As I figured out what was the issue and I think it might be useful information for other users I will present the solution.
What helped me, was formatting the timestamp in Excel column as a text. Meaning it could not be neither number formatted as timestamp, nor a result of TEXT FUNCTION. It had to be a plain text. In attached screen you can se what I tried to do and the results in SQL DEVELOPER.
To make values in C column I copied and pasted as values Column B - it pastes those as a text and not as a numbers.
Presentation of the solution
Hope this will help someone in the future.
I have a datetimestamp field in SSRS, when I preview the report the data looks okay (2015-06-23 1:33:00 PM), but when I export the report to excel it creates ############### and not showing the date time. The dataset is done in SQL query cast(m.CallTime as datetime). What I want to happen is to display just the time in SSRS and Excel (1:30 PM). Thanks.
I've always had issues with the Excel export with date formats but I think that's more due to Excel propensity to guess wrong at the format I want. Why is it whenever I have a date with no time, it usually is formatted as time only (0:00)? Very annoying.
Make sure that your date is in a date format. You casted it in your query but you could also use CDATE to do it in SSRS.
Set the format using the Textbox's FORMAT Property to hh:mm tt .
It should come out as specified in Excel.
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.