execute sql in excel
I'm trying to run execute sql in excel using dateadd and datediff but
having error "No value given for one or more required parameters."
here is the sample query im running. thanks
SELECT datediff(month, "2/2/2019", "3/1/2018") from table
can you please help with the correct syntax? thanks
I used "select FORMAT([Field], 'dd-MM-yyyy')" hope this helps.
Have you managed to make it work? I'm also interested in the DATEDIFF function.
Also, I can't update SQL withe the %CurrentDate% parameter...and also it doesn't work to compare a [Field] with the %CurrentDate%
What I did was use addtodatetime first then use that variable in sql query.
select a from [table$] where [salesdate] < #%adddate%#
Those who do not know how to execute the SQL in the excel can know from here and it will be very useful for those who are in the database filed.