The code is written in postgresql and run in pgadmin 4.
I am trying to get the id from the pricing table if the current date lies in between the given start date and end date.
I am trying to get the id from the pricing table if the current date lies in between the given start date and end date.
select id
from pricing
where current_Date between start_date>=date '2022-10-19' AND end_date<=date '2022-10-20';
The error raises
operator does not exist: date >= boolean LINE 3: where
current_Date between start_date>=date ‘2022-10-19’…
2
Answers
between
only expects the values:Your
where
condition is essentiallysomeDate between someBoolean and someOtherBoolean
, which confuses compiler. Use just this: