Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 How do I send report builder variable to ODBC

Author  Topic 

RogerPeckham
Starting Member

2 Posts

Posted - 2013-06-07 : 11:57:12
I have a query that works in report builder to pull info from an ODBC datasource with the start and end date hard coded. I'd like to set it up to allow the user to input start and end date as a variable, but when I do I get a lexicon missing error message, any ideas on how to do it?

Working code:
Select History.TimeStamp, History.Value001
From History History
Where (History.Parameter001='pointname.pointvalue') and (history.timestamp>={ts '2013-05-01 00:00:00'} and history.timestamp<={ts '2013-05-13 23:59:00'})

I'd like to substitute @startdate and @enddate to prompt user input, but cant get it to work.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-08 : 04:29:55
you can add parameters when you create report using report builder.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

RogerPeckham
Starting Member

2 Posts

Posted - 2013-06-18 : 19:37:08
changing the '2013-05-01 00:00:00' to a parameter gives me a missing lexical error 42000
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-06-19 : 01:16:40
where are you trying to change this? Did you add a parameter from report designer window?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -