Using variables to select date span

Hi there,
I created a table with three columns with the following information:

  1. description
  2. start_date
  3. end_date

I created a custom variable called [schoolyear] to be able to filter the data based on the startdate.
Variables: 24/25, 25/26

Now, when for example the schoolyear 24/25 is selected, i only want voyages to show with a start_date between 2024-10-22 and 2025-05-22. I have been experimenting with CASE, WHERE, etc. but can’t get it to work.

Can anyone help me with this, and is it even possible?

Some examples:

When 24/25 is selected, it should give me this result:

SELECT 
description, start_date, end_date
FROM swandb2.trip

WHERE 
  start_date BETWEEN '2024-10-22' AND '2025-05-22'

And, when 25/26 is selected it should give me this result:

SELECT 
description, start_date, end_date
FROM swandb2.trip

WHERE 
  start_date BETWEEN '2025-10-22' AND '2026-05-22'