You can translate the question and the replies:

Converting ORACLE Data Data Type to Integer in Denodo

Hi, I am using an ORACLE table as my data source and need to convert DATE data type to integer format (YYYYMMDD). I tried using the syntax below and getting an error in Denodo. CAST(CONVERT(VARCHAR(8), address_01_filtered.add_from, 112) AS INTEGER) If I use CAST(CAST(address_01_filtered.add_from AS FLOAT) AS INTEGER) AS StartDateINT, I get the error message "Unsupported CAST between FLOAT and DATE'.
user
09-03-2017 13:59:47 -0500

2 Answers

Hi, I was able to convert a date value into a integer data type in VDP by using any of the following expressions: ``` cast('int',concat(getyear(<field_name>), getMonth(<field_name>), getday(<field_name>))) ``` OR ``` cast('int',formatdate('yyyyMMdd',<field_name>)) from <view_name> ``` Click on the Help menu > Functions List where you can find lots of predefined functions related to date available in VDP. Also please refer Advanced VQL guide where it explains with example on how to use these functions. Hope this helps.
Denodo Team
13-03-2017 09:50:20 -0400
Thank you! This worked.
user
13-03-2017 10:42:30 -0400
You must sign in to add an answer. If you do not have an account, you can register here