You can translate the question and the replies:

Lastdayofmonth for prior month is Denodo

Im trying ot get last day of the month with : LASTDAYOFMONTH(addmonth(current_date(),-1)). The above query gives result as : 2023-12-31 However when I run the same with few more lines of code: select field_name from "table_name" where "field_name" between case WHEN (getmonth(addmonth("field_name", -12)) > 6) THEN cast('localdate', addmonth(trunc(ADDMONTH(current_date(), -12 ), 'YYYY'), getmonth(addday("field_name", -12)))) ELSE cast('localdate', trunc(addmonth(current_date(), -12), 'YYYY')) END AND LASTDAYOFMONTH(addmonth(current_date(),-1)) I'm getting the following error: Received exception with message '[Teradata Database] [TeraJDBC 17.20.00.15] [Error 2665] [SQLState 22007] Invalid date.' What is the right syntax for the above query ???
user
01-01-2024 05:15:04 -0500
code

1 Answer

Hi, At the moment, the error ‘Invalid date’ on the execution of **'LASTDAYOFMONTH(addmonth(current_date(),-1))'** function has been identified as a **defect** in the Denodo Platform 8.0 and it will be fixed in the future update. If you would like to get more assistance on this error , and if you have valid Support access, then you could open a new Support case so that our Support team will assist you. Hope this helps!
Denodo Team
03-01-2024 05:16:33 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here