You can translate the question and the replies:

Interpolation Variable - Date function

Hi, I am trying to create a base view with query from DB2 in which I included 2 parameters Begin_date, End_date that are added in where clause to filter Date(confirm_date) column. Example: Select * from Table where Date_column between @Begin_date and @End_date 1. This query to create base view. 2. Parameter values gave as '2021-11-01' , '2021-11-30' respectively. 3. the value is picked up as integer by denodo in view as column. 4. In execution panel add values and run the query. Results: verified with different formats and functions and the results cross checked with having parameter as column. if direct variable is added the value of 2021-11-01 is coming as 2009 etc. if date(parameter) is given in query then getting some weired values like 0006-06-30.
user
04-11-2022 07:10:34 -0400
code

2 Answers

Hi I tried executing a similar base view created using the **Create from query** option with date columns as interpolation variables (@Begin_date, @End_date), but I didn’t get the expected results. However, when I created the base view by enclosing the date parameters in single quotes I was able to get the expected results. For instance, I used the below query in the **Create Base View From SQL tab.** >Select * from <Table_Name> where <Date_Column> between ‘@begin_date’ and ‘@end_date’; By enclosing the interpolation variable using single quotes i.e: '@begin_date’, ‘@end_date’ I could make sure the actual date values passed in the VQL (e.g. ‘2021-11-01’ , ‘2021-11-30’) are interpreted correctly in the delegated SQL Query. Hope this helps!
Denodo Team
07-11-2022 03:57:31 -0500
code
Thank you that worked out.
user
09-11-2022 13:21:04 -0500
You must sign in to add an answer. If you do not have an account, you can register here