You can translate the question and the replies:

Prior year last business day retrivel

Hi there, I am trying to retrive last business day of last year though this query select dateadd(yy,datediff(yy,-1,@date),-1)[In sql], but in denodo I am not able to find any solution here, so can you please help me out, Thanks,
user
20-08-2021 13:29:49 -0400
code

1 Answer

Hi, In such a situation where there exists a function in the Source that can perform the required operations, I would create a view in the Virtual DataPort server using the Source native query. That is, I would use the **[Create from Query](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/creating_data_sources_and_base_views/jdbc_sources/jdbc_sources#creating-base-views-from-sql-queries)** option to create a base view that would use the function to display the desired output. I would provide the following query in the **Create Base view From SQL Query** dialog box and provide an interpolation variable (Eg : @date) for the date column so as to provide an input every time the view gets executed. ``` select dateadd(yy,datediff(yy,-1,'@date'),-1) as lastdayofyear ``` You can take a look at the Knowledge Base article [Using the Create Base View From Query Option](https://community.denodo.com/kb/en/view/document/Using%20the%20Create%20Base%20View%20From%20Query%20Option) for more information. Hope this helps!
Denodo Team
24-08-2021 03:11:16 -0400
code
You must sign in to add an answer. If you do not have an account, you can register here