You can translate the question and the replies:

How do I store "2014-12-31" as just a date, without the time and without a timezone?

Hi, I have a 3rd party web service that returns "2014-12-31" as one of the field values and I'd like to store it as a date in Denodo, (not a datetime: I don't want any timezone information stored nor time information... I just want the date). Can I store this as a date without all the extra time and timezone information? What is the recommended approach, especially when I have queries coming in where I'd like to select rows that have a field value that is >= a certain date. Thank you~!
user
31-08-2015 13:54:01 -0400
code

1 Answer

Hi, Denodo date types always use the timezone information. If you need to use a text value, e.g. "2014-12-31", as a date value to execute conditions over dates, you need to convert this field to a date. To get this, you can use either the TO_DATE function or you can import the field changing the type to date, if the field has a format that is compatible with the i18n used for that view. The section "TO_DATE" of "the Advanced VQL Guide" contains information about how to use the TO_DATE function. You can use the parameter "timestamp" with the value "false", so the function sets to 0 the fields that represent the time. Keep in mind that, as date types include timezone information, you can get a different representation of a date field using VDP admin tool if you use different Locales and the option "Internationalize query results". There is more information available about the "Internationalize query results" in the section "Locale" of the Virtual DataPort Administration Guide. Hope this helps!
Denodo Team
01-09-2015 10:08:11 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here