Run calculation not working in sub query, "does not exist"
Your error was that Postgres interpreted the column as Integer and performs a Euclidean division, which leads to the zero encountered.
Changing the car_count_last_week to a decimal, will give you the rational numbers division
 (car_count_last_week::decimal/100)

fixes the problem


CREATE TABLE IF NOT EXISTS car_store (
     car_id INT GENERATED ALWAYS AS IDENTITY,
     car_date  TIMESTAMP,
     car_time TIMESTAMP NOT NULL,
     car_name VARCHAR(255) NOT NULL,
     PRIMARY KEY(car_id)
  )




INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-03 15:28:00.116594');
INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-11 16:13:07.217903'); 
INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-01 18:03:27.217903'); 
INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-14 18:03:27.217903'); 
INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-12 18:03:27.217903'); 
INSERT INTO car_store(car_name, car_time) VALUES ('awesome', '2021-05-13 18:03:27.217903');  




WITH last_week AS (
  SELECT COUNT(car_time) as car_count_last_week
  FROM car_store
  WHERE car_name = 'awesome'
  AND car_time &gt;= date_trunc('week', CURRENT_DATE - INTERVAL '1 week')
  AND car_time &lt;= CURRENT_DATE - INTERVAL '6 days'
), current_week AS (
  SELECT COUNT(car_time) AS car_count_current_week
  FROM car_store
  WHERE car_name = 'awesome'
  AND car_time &gt;= date_trunc('week', CURRENT_DATE)
  AND car_time &lt;= CURRENT_DATE
)
SELECT car_name,
  date_trunc('week', CURRENT_DATE - INTERVAL '1 week') AS start_of_last_week,
  CURRENT_DATE - INTERVAL '6 days' AS today_but_last_week,
  date_trunc('week', CURRENT_DATE) AS start_of_current_week,
  CURRENT_DATE AS today,
  car_count_last_week,
  car_count_current_week
  ,
  
 CASE WHEN car_count_last_week = 0 then 1
 ELSE ROUND(car_count_current_week/(car_count_last_week::decimal/100)) * 100 
 END 
   AS difference_between_weeks
  FROM car_store
  CROSS JOIN last_week, current_week
  WHERE car_name = 'awesome'
  GROUP BY car_name, car_count_last_week, car_count_current_week
  ORDER BY car_name;


car_name | start_of_last_week  | today_but_last_week | start_of_current_week  | today      | car_count_last_week | car_count_current_week | difference_between_weeks
:------- | :------------------ | :------------------ | :--------------------- | :--------- | ------------------: | ---------------------: | -----------------------:
awesome  | 2021-05-03 00:00:00 | 2021-05-09 00:00:00 | 2021-05-10 00:00:00+01 | 2021-05-15 |                   1 |                      4 |                    40000


db&lt;&gt;fiddle here