# dbt ref parser error: syntax error or near .

**URL:** <https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988>\
**Category:** Help\
**Tags:** dbt-core\
**Created:** [November 29, 2023, 11:50pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988 "2023-11-29T23:50:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chihlinc](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/chihlinc/32/3252_2.png) [@chihlinc](https://discourse.getdbt.com/u/chihlinc)\
**Post date:** [November 29, 2023, 11:50pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988/1 "2023-11-29T23:50:43Z")

</div>

## The problem I’m having

## The context of why I’m trying to do this

## What I’ve already tried

## Some example code or error messages

```auto
select weekday(started_at_ts) as weekday, count(*) as total_trips, sum(duration_sec) as total_trip_duration_secs 

from {{ ref('mart__fact_all_bike_trips')}}
group by all; 

```

When I tried to type {{ ref from the table, it shows an error for parser error: syntax error or near .  
I tried look up at the table, its exisiting. I dont know how to solve this problem.

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [November 30, 2023, 12:51pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988/2 "2023-11-30T12:51:11Z")

</div>

Did you try removing the semicolon from

```auto
group by all; 

```

?

---

<div class="post-metadata">

**Author:** ![chihlinc](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/chihlinc/32/3252_2.png) [@chihlinc](https://discourse.getdbt.com/u/chihlinc)\
**Post date:** [November 30, 2023, 4:34pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988/3 "2023-11-30T16:34:29Z")

</div>

@brunoszdl yes, I tried to remove the semicolon. Is there any other way that you suggest me going for it?

---

<div class="post-metadata">

**Author:** ![brunoszdl](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/brunoszdl/32/4113_2.png) [@brunoszdl](https://discourse.getdbt.com/u/brunoszdl)\
**Post date:** [November 30, 2023, 4:45pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988/4 "2023-11-30T16:45:46Z")

</div>

Can you paste here the whole error message?

---

<div class="post-metadata">

**Author:** ![chihlinc](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/chihlinc/32/3252_2.png) [@chihlinc](https://discourse.getdbt.com/u/chihlinc)\
**Post date:** [November 30, 2023, 5:14pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988/5 "2023-11-30T17:14:25Z")

</div>

@brunoszdl Here is the message.  
Error: near line 1: Parser Error: syntax error at or near “{”  
LINE 5: from {{ ref(‘mart\_\_fact\_all\_bike\_trips’) }}  
^

---

<div class="post-metadata">

**Author:** ![alyk](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/alyk/32/3347_2.png) [@alyk](https://discourse.getdbt.com/u/alyk)\
**Post date:** [December 4, 2023, 10:33pm UTC](https://discourse.getdbt.com/t/dbt-ref-parser-error-syntax-error-or-near/10988/6 "2023-12-04T22:33:11Z")

</div>

hm. first says the error is at or near `.` second says error is around the `{` …  
Are you using dbt cloud or some other ide ? could there be hidden/unexpected char/unicode in your code? What’s the whole model look like?

I removed the ; and changed commands/refs to work for ❄ and dbt jaffle project and this builds fine:

```auto
select dayname(order_date) as weekday, count(*) as total_trips, sum(order_id) as total_trip_duration_secs 

from {{ ref('fct_orders')}}
group by all

```
