# Filter data SqlLite in table

**URL:** https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269
**Category:** General
**Tags:** node-red-dashboard, database
**Created:** [13 April 2022 22:18 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269 "2022-04-13T22:18:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![eruiz](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eruiz](https://discourse.nodered.org/u/eruiz)
#### Post date: [13 April 2022 22:18 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/1 "2022-04-13T22:18:13Z")

</div>

Hello good afternoon, I tell you what I want to do, filter a database by temperature and date, currently I show all the data in a table, but I want to filter it, I know what sentence using a sentence like: "select \* from 'database' where 'temperature = 15', it will be filtered, but what I'm looking for is that I don't write the filter temperature, if I don't give it to a variable for example, thank you very much, I attach my flow.

[flows (1).json](https://discourse.nodered.org/uploads/short-url/aZmRqaXFelEDwISX3IOL5evmgmO.json) (79.7 KB)

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [14 April 2022 11:29 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/3 "2022-04-14T11:29:39Z")

</div>

So why not use the date in stead of the temperature in your ‘where’ clause?

---

<div class="post-metadata">

### Author: ![eruiz](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eruiz](https://discourse.nodered.org/u/eruiz)
#### Post date: [14 April 2022 13:09 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/4 "2022-04-14T13:09:13Z")

</div>

Of course I can do that, but what I want to do is that in a date node or tex input node, enter date or date data and filter dynamically, all those filters do it from the UI

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [14 April 2022 13:58 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/5 "2022-04-14T13:58:12Z")

</div>

Do you mean you want to enter a date on the dashboard and press enter, then use that date in the where clause?

---

<div class="post-metadata">

### Author: ![eruiz](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@eruiz](https://discourse.nodered.org/u/eruiz)
#### Post date: [14 April 2022 18:57 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/6 "2022-04-14T18:57:55Z")

</div>

yes, that's exactly what I want to filter both by date and perhaps temperature values ​​in the same statement.

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [14 April 2022 22:27 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/7 "2022-04-14T22:27:16Z")

</div>

> [@eruiz](#):
>
> I want to filter both by date and perhaps temperature values ​​in the same statement.

Well you could build the sql statement using switch nodes to decide if you want date, temperature or both ad then use a template node to build the statement.

You will have to decide what the conditions re that you will use. I'd suggest using the `ui-form` node to enter the date and/or temperature they both would be in the msg and you could then create your select statement based on which item(s) are filled in.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [13 June 2022 22:27 UTC](https://discourse.nodered.org/t/filter-data-sqllite-in-table/61269/8 "2022-06-13T22:27:17Z")

</div>

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