# Get balances BETWEEN two dates

**URL:** <https://community.bitquery.io/t/get-balances-between-two-dates/108>\
**Category:** GraphQL API\
**Tags:** closed\
**Created:** [June 3, 2021, 2:42pm UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108 "2021-06-03T14:42:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcell033](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@marcell033](https://community.bitquery.io/u/marcell033)\
**Post date:** [June 3, 2021, 2:42pm UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/1 "2021-06-03T14:42:00Z")

</div>

The following query does not work when time selector is “between”, while it works with “till” or “before”.  
BitQuery throws the following message:

> {“message”: “This selector can not be applied to time, use ONLY till or before”, “locations”: [{ “line”: 5, “column”: 7 }], “path”: [“ethereum”, “address”, 0, “balances”] } ]

```auto
{
  ethereum (network: bsc){
    address(address: {is: $address}) {      
      address
      balances(
        currency: {is: $currency}
        time: {between: ["2021-05-12T13:01Z", "2021-05-21T13:01Z"]}
      ) {
        currency {
          symbol
          address
          name
          decimals
        }
        value
        history {
          block
          value
          transferAmount
          timestamp
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [June 4, 2021, 6:39am UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/2 "2021-06-04T06:39:48Z")

</div>

To get a balance till a point in time you can use the following query

```auto
{
  ethereum (network: bsc){
    address(address: {is: "0xfE54C0A978B477Fc06faBa4a822516977E931eA9"}) {      
      address
      balances(
        currency: {is: "0x83a86adf1a7c56e77d36d585b808052e0a2aad0e"}
        time: {till: "2021-06-12T13:01Z"}
      ) {
        currency {
          symbol
          address
          name
          decimals
        }
        value
        history {
          block
          value
          transferAmount
          timestamp
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![marcell033](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@marcell033](https://community.bitquery.io/u/marcell033)\
**Post date:** [June 4, 2021, 7:57am UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/3 "2021-06-04T07:57:44Z")

</div>

HI @gaurav  
Thanks for your reply.

Yes, I know I can do that, but i’d like to specify a time range BETWEEN two points in time, not till or before.

---

<div class="post-metadata">

**Author:** ![kfish](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/kfish/32/21_2.png) [@kfish](https://community.bitquery.io/u/kfish)\
**Post date:** [June 5, 2021, 4:47pm UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/4 "2021-06-05T16:47:24Z")

</div>

Have you tried using

```auto
time: { between: [$from, $till] }

```

---

<div class="post-metadata">

**Author:** ![marcell033](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@marcell033](https://community.bitquery.io/u/marcell033)\
**Post date:** [June 5, 2021, 5:30pm UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/5 "2021-06-05T17:30:12Z")

</div>

Of course

And i get

> {“message”: “This selector can not be applied to time, use ONLY till or before”, “locations”: [{ “line”: 5, “column”: 7 }], “path”: [“ethereum”, “address”, 0, “balances”] } ]

---

<div class="post-metadata">

**Author:** ![kfish](https://sea2.discourse-cdn.com/flex016/user_avatar/community.bitquery.io/kfish/32/21_2.png) [@kfish](https://community.bitquery.io/u/kfish)\
**Post date:** [June 5, 2021, 6:19pm UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/6 "2021-06-05T18:19:42Z")

</div>

Oh, I should have tried it myself… Sorry!

Try this maybe? Using both since and till:

```auto
{
  ethereum (network: bsc){
    address(address: {is: "0xfE54C0A978B477Fc06faBa4a822516977E931eA9"}) {      
      address
      balances(
        currency: {is: "0x83a86adf1a7c56e77d36d585b808052e0a2aad0e"}
        time: {since: "2021-05-12T13:01Z" till: "2021-05-21T13:01Z"}
      ) {
        currency {
          symbol
          address
          name
          decimals
        }
        value
        history {
          block
          value
          transferAmount
          timestamp
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![marcell033](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@marcell033](https://community.bitquery.io/u/marcell033)\
**Post date:** [June 6, 2021, 4:39pm UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/7 "2021-06-06T16:39:25Z")

</div>

Hi, thanks for your advice

Unfortunately, this approach is not working. It only considers the till.

---

<div class="post-metadata">

**Author:** ![gaurav](https://avatars.discourse-cdn.com/v4/letter/g/b487fb/32.png) [@gaurav](https://community.bitquery.io/u/gaurav)\
**Post date:** [June 7, 2021, 8:09am UTC](https://community.bitquery.io/t/get-balances-between-two-dates/108/8 "2021-06-07T08:09:39Z")

</div>

I believe for now, there is no way to get the balance between defined date, query only consider 1 parameter and ignore other.
