How do I pass parameters to my SQL statement?

55 Views Asked by At

How can I use parameters to create a dynamic SQL statement? I specified two parameters "DateStart" and "DateEnd" which I want to include in my Data source's SQL statement, but I don't know what the proper way to reference them is.  My aim is to have the users be able to adjust the parameter dates at the opening of the report.

For Example:

Select projectid,projectname,date,agent,count(*) from production Where
fromdate = '04/01/2020' and to date = '04/05/2020" Group by Projectid,
Projectname,date,agent

Now, dates filters will be added in Excel cells and based on inputs result will appear on the table.

Also, advise will that work in MS Office 2016 & O365 version as well.

Thank you in Advance!

0

There are 0 best solutions below