Hi,
I have a SQL DB stored procedure that accepts a datetime input.
The idea is to run this as a saved report daily and overwrite the output lookup table with results.
The following works when I hardcode the date in the params field:
| dbxquery connection="MyDBConnection" query="{call MyStoredProc(?)}" params="2023-07-09"
Now, I need to use a variable in the params field to pass the current date dynamically.
| eval currentDate = strftime(now(), "%Y-%m-%d")
| dbxquery connection="MyDBConnection" query="{call MyStoredProc(?)}" params=\"$currentDate$\"
With the above I keep getting an error :
om.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type nvarchar to datetime2.
So how do I get the current date as a variable, and use it as an input parameter for a stored proc? Thanks!