Why do I get an error when trying to run this code on Metabase?

Viewed 15
SELECT((SELECT count(*) 
FROM `bookings`
WHERE `bookings`.`status` = 'collect_payment'
AND {{created_at}}))
/
((SELECT count(*) 
FROM `bookings`
AND {{created_at}})
 ;

I am trying to divided two values by dividing two select statement but it does not work

1 Answers

Here is the updated working query:

SELECT((SELECT count(*) 
FROM `bookings`
WHERE `bookings`.`status` = 'collect_payment'
AND {{created_at}}))
/
((SELECT count(*) 
FROM `bookings`
AND {{created_at}}))

Did you map / configure {{created_at}} ? If not mapped already, map it and rerun the query.

Related