Create a calculated new column in a database view

Job ID: 36380454

Budget: $10 – $30 USD

Hello,

I have a Snowflake database, which has 3 columns,
Column 1 is a unique identifier and Column 2 and 3 are start and end date for leave.

I want a new column based on following condition:

IF ACTUAL_LEAVE_START_DATE is not null
Count the number of days between 2023-05-11 - 2023-06-01 for
ACTUAL_LEAVE_START_DATE and ACTUAL_LEAVE_START_DATE if not null.

For example if

ACTUAL_LEAVE_START_DATE = 2023-05-15
ACTUAL_LEAVE_START_DATE = 2023-05-29

The the days between would be 14 days

Similarly if,
ACTUAL_LEAVE_START_DATE = 2023-04-15
ACTUAL_LEAVE_START_DATE = 2023-06-1

The the days between would be 21 days

Needs to be done ASAP, I will share the data for the table with you in excel and I want the query in return.
Related categories: SQL Snowflake