Streamlit Range without a Slider

Is there a way to select a range of values say between 100 and 1000 in streamlit and get a SQL like statement of BETWEEN 100 and 1000?

Sure, just use fstring.

Eg. Sqlstr = f"SELECT * FROM Products
WHERE Price BETWEEN {x} AND {y}"

x & y = widget variables

Cheers

Hi @Shawn_Pereira ,
And this widgets will be say number input or text input? I am trying to create interactive SQL Query Dashboard.

This has to be a number input, as you want to use it with BETWEEN

OR

if it is a text input, you will have to change / convert it to a number before you can use it.

Cheers

Okay @Shawn_Pereira . Thanks for the answer.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.