0

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!

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
King
  • 13
  • 4
  • Does it have to be a SQL statement? If you use Power Query, you can read parameters from Excel cells and the Power Query will use query folding to produce the most efficient SELECT statement based on the steps you defined. – teylyn Apr 06 '20 at 21:09
  • I have solved the problem... – King Apr 15 '20 at 02:13
  • You can answer your own question and share how you solved it. This is what this community is all about. – teylyn Apr 15 '20 at 20:40

0 Answers0