The title problaby gives away what i'm trying to do, it's just curiosity, i'm trying to find the next friday from a set of dates, but if that date is friday i want to return that date and not the next.

Here's what i'm trying to do: (Using the employees table from Oracle)

```
SELECT first_name,
     CASE WHEN to_char(hire_date, 'DAY') = 'FRIDAY' THEN hire_date
          ELSE next_day(hire_date, 'FRIDAY')
     END as next_friday, hire_date, to_char(hire_date, 'DAY')
FROM hr.employees;

```

[![enter image description here](https://i.stack.imgur.com/kalXr.png)](https://i.stack.imgur.com/kalXr.png)

I don't see what's wrong with the query (those two marked records the date should be the same in the 2nd and 3rd column), it's logically correct in my point of view, i made a CASE statement and transformed the hire\_date with to\_char to see if it's friday and if it was return the hire\_date, else return the next friday using the next\_day function.

What could be wrong?