StartDate and EndDate in a query

Hi, does somebodyknow if I can use the parameters StarDate and EndDate in a sql basic query?
I´m trying to use these parameters to limit my datas using my t_stamp.
WHERE t_stamp >={StartDate} AND t_stamp <= {EndDate};
it isn´t working :frowning:

Hi,
In named query, create 2 parameters as StartDate and EndDate as Data Type DateTime and used this parameters in your where clause.

As
WHERE t_stamp >=:StartDate AND t_stamp <= :EndDate;

OP tagged this as reporting, so the answers about named queries won't apply.

In reporting data sources, you can use any of the parameters or queries that are defined above the one you're defining as inputs to the data source you're working on. That said, for what you're doing a SQL Query Data Source will work better than a Basic SQL query. The example in the docs show how to use a parameter in your query.

2 Likes

Thank you so much, yes I had to changed the basic sql query to sql query and I use the question marks "?" to generate new parameters and there I dropped my StartDate and EndDate

1 Like