I am updating from a cte but got this common error
`The multi-part identifier "t.newfips" could not be bound.` I know how to handle this error in other cases, but I don't know how in this case.

My query

```
with t as (
select * from FIPSModificationsBEA t1
inner join [BEAtoFIPS] t2
on cast(t1.newfips as varchar) = concat(t2.statefips,t2.CountyFIPS)
)
update [BEAtoFIPS]
set statefips = left(t.oldfips, 2) , countyfips = right(t.oldfips, 3)
from [BEAtoFIPS] t2
where concat(t2.statefips, t2.countyfips) =  t.newfips
go

```

I checked the query by the following query

```
with t as (
select * from FIPSModificationsBEA t1
inner join [BEAtoFIPS] t2
on cast(t1.newfips as varchar) = concat(t2.statefips,t2.CountyFIPS)
)
select newfips from t
go

```

This query works. Thus, I am confused. Why the latter one works but the former one does not? Aren't they essentially the same in structure? What's wrong with the former one?