# Getting error while running from statement

**URL:** https://community.influxdata.com/t/getting-error-while-running-from-statement/33747
**Category:** Systems
**Created:** [March 29, 2024, 2:44pm UTC](https://community.influxdata.com/t/getting-error-while-running-from-statement/33747 "2024-03-29T14:44:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Everest](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@Everest](https://community.influxdata.com/u/Everest)
#### Post date: [March 29, 2024, 2:44pm UTC](https://community.influxdata.com/t/getting-error-while-running-from-statement/33747/1 "2024-03-29T14:44:02Z")

</div>

Getting error while running below command. I am new and this is part of my school project. I slected bucket name and measurement on left pane.  
from(bucket: “bucketname”)  
|\> range(start: 2024-03-11T15:00:00Z , stop: 2024-03-12T11:00:00Z)  
|\> filter(fn: (r) =\> r.\_measurement == “airSensors”)  
|\> filter(fn: (r) =\> r.sensor\_id == “TLM0100”)

Error while planning query: SQL error: ParserError(“Expected an SQL statement, found: from”): rpc error: code = InvalidArgument desc = Error while planning query: SQL error: ParserError(“Expected an SQL statement, found: from”)

---

<div class="post-metadata">

### Author: ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)
#### Post date: [March 29, 2024, 7:48pm UTC](https://community.influxdata.com/t/getting-error-while-running-from-statement/33747/2 "2024-03-29T19:48:54Z")

</div>

Looks like youre using 3.x are you using a free cloud trial?  
If that’s the case you gotta use SQL instead of Flux.

> **[Query data with SQL | InfluxDB Cloud Serverless Documentation](https://docs.influxdata.com/influxdb/cloud-serverless/query-data/sql/)**
>
> Learn to query data stored in InfluxDB Cloud Serverless using SQL.

You can use the UI to query in sql as well and turn on the sql sync and it should write the sql for you.
