Calculate total days in a date range variable

Good morning everyone, I have a question for you:

On my query I have a variable {{DATE}} which is a date range (in a postgresql database).

However, I would then like to extrapolate the total number of days in that date range depending on what the user selects.

Is it possible to do this? thanks