# Datewise data retrieval from Firebase

**URL:** https://community.thunkable.com/t/datewise-data-retrieval-from-firebase/897685
**Category:** Questions about Thunkable X
**Created:** [October 13, 2020, 11:32am UTC](https://community.thunkable.com/t/datewise-data-retrieval-from-firebase/897685 "2020-10-13T11:32:59Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shirohin6](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shirohin6](https://community.thunkable.com/u/shirohin6)
#### Post date: [October 13, 2020, 11:32am UTC](https://community.thunkable.com/t/datewise-data-retrieval-from-firebase/897685/1 "2020-10-13T11:32:59Z")

</div>

Hi,

I am sending data to Firebase with a date range (From & To date). I then want to read data from Firebase for a specific date. How do I do it?

Thanks

---

<div class="post-metadata">

### Author: ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)
#### Post date: [October 13, 2020, 1:45pm UTC](https://community.thunkable.com/t/datewise-data-retrieval-from-firebase/897685/2 "2020-10-13T13:45:58Z")

</div>

[shirohin6](http://community.thunkable.com/u/shirohin6),

I am not aware of any built-in Thunkable functions to search the Firebase Realtime DB using criteria.

The only way I have found is to loop through the JSON (for each … In List…) and create blocks to compare dates (if value \>= XXX and value \<= YYY THEN ). Make sure in Firebase you set the date format to YYYY-MM-DD or parsing the date will be a nightmare. When saving dates, be sure to use leading zeros on MM and DD, otherwise your \>= and \<= comparsions may not work correctly.

This solution will require a LOT of block and will depend on the structure of your JSON tree. I would recommend you wrap all of those blocks into a function with at least 3 input parameters: 1)JSON list to search, 2) start date, 3) end date, with a return value of the matching object.

Good Luck, Happy Thunking!

---

<div class="post-metadata">

### Author: ![shirohin6](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shirohin6](https://community.thunkable.com/u/shirohin6)
#### Post date: [October 19, 2020, 2:07pm UTC](https://community.thunkable.com/t/datewise-data-retrieval-from-firebase/897685/3 "2020-10-19T14:07:44Z")

</div>

Thanks Drted. I was thinking on the same lines and was able to do it.

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 12:22pm UTC](https://community.thunkable.com/t/datewise-data-retrieval-from-firebase/897685/4 "2024-11-08T12:22:03Z")

</div>


