I am working in Oracle server and want to run the following query inside excel workbook
Select current_timestamp, FROM_TZ(CAST(current_timestamp AS TIMESTAMP), 'UTC') at time zone 'Europe/Helsinki'
from
MYDB OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY
When I ran SQL in SQL Workbench, everything works perfectly, but when I try to create a connection to Oracle server from Excel and run the same query I have the following error in the workbook
As I understood, my driver does not read FROM_TZ(CAST(..))) function in Excel. How Can I modify my query to start working in Excel?
Driver is Oracle in OraClient11g_home1 (64 bit)
UPDATE:
This error also comes if I use the following functions in Excel:
cast(DATA_DTTM as timestamp) AT TIME ZONE 'UTC' as utc
FROM_TZ(CAST(DATA_DTTM AS TIMESTAMP), 'UTC')
FROM_TZ(CAST(DATA_DTTM AS TIMESTAMP), 'UTC') at time zone 'Europe/Helsinki'
I want to tell that the certain timestamp column is in UTC
format and then convert it to 'Europe/Helsinki'
, but Excel does not read AT TIME ZONE 'UTC'
and FROM_TZ()
(I tried to run them in Excel separately) + the same issue with TO_TIMESTAMP_TZ()
function
Before I used Vertica and this manipulation was done by cast(DATA_DTTM as timestamp) AT TIME ZONE 'UTC' AT TIME ZONE 'Europe/Helsinki' as utc
The code I used:
select
cast(DATA_DTTM as timestamp) AT TIME ZONE 'UTC' as utc
FROM_TZ(CAST(DATA_DTTM AS TIMESTAMP), 'UTC')
FROM_TZ(CAST(DATA_DTTM AS TIMESTAMP), 'UTC') at time zone 'Europe/Helsinki'
from MYDB
Are there any alternative ways to set timestamp timezone and then convert it to another timezone?