# Streamlit Range without a Slider

**URL:** <https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228>\
**Category:** Using Streamlit\
**Created:** [July 2, 2022, 4:33am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228 "2022-07-02T04:33:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnesther](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@johnesther](https://discuss.streamlit.io/u/johnesther)\
**Post date:** [July 2, 2022, 4:33am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228/1 "2022-07-02T04:33:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Shawn\_Pereira](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/shawn_pereira/32/44502_2.png) [@Shawn\_Pereira](https://discuss.streamlit.io/u/Shawn_Pereira)\
**Post date:** [July 2, 2022, 5:11am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228/2 "2022-07-02T05:11:36Z")

</div>

Sure, just use fstring.

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

x & y = widget variables

Cheers

---

<div class="post-metadata">

**Author:** ![johnesther](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@johnesther](https://discuss.streamlit.io/u/johnesther)\
**Post date:** [July 2, 2022, 5:39am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228/3 "2022-07-02T05:39:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shawn\_Pereira](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/shawn_pereira/32/44502_2.png) [@Shawn\_Pereira](https://discuss.streamlit.io/u/Shawn_Pereira)\
**Post date:** [July 2, 2022, 5:58am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228/4 "2022-07-02T05:58:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![johnesther](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@johnesther](https://discuss.streamlit.io/u/johnesther)\
**Post date:** [July 2, 2022, 5:59am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228/5 "2022-07-02T05:59:38Z")

</div>

Okay @Shawn_Pereira . Thanks for the answer.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/streamlit/original/3X/c/f/cf4c2ee0d938358f82448c5fe4b9c3c91d7ce19c.svg) [@system](https://discuss.streamlit.io/u/system)\
**Post date:** [July 2, 2023, 6:00am UTC](https://discuss.streamlit.io/t/streamlit-range-without-a-slider/27228/6 "2023-07-02T06:00:21Z")

</div>

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