Hi,
I try to add a number of days to the current date. In general it is not a problem, but I have not direct access to SQL Server and the request will be transferred via a middleware. However, I have the following statement:
Select DATEADD(day,%1,CONVERT(DATETIME, getdate(), 103))
%1 is a variable for the middleware. The problem is, that all values are transferred with quotes.
If I want to add days I set %1 in the middleware and in the sql statement it will be '10'. As consequence I receive the following error:
[[Microsoft][ODBC SQL Server Driver][SQL Server]Argument data type varchar is invalid for argument 2 of dateadd function. - Select DATEADD(day,'10',CONVERT(DATETIME, getdate(), 103))]
I there a way to remove the quotes in the SQL statement? I tried this:
replace(%1,'''','')
but it didn't work.I hope you have some ideas.
Best regards,
Lara