I want to create a date based on system date. The reference date is 1st July of each year. If the the system date is greater that 1st July of that year, the new date column should store 1st July of that year as the date. Otherwise, if the system date is less than 1st July of that year, it should store 1st July of last year as the date.
For e.g
sysdate= 01/08/2020(DD/MM/YYYY)
then new_date_stored = 01/07/2020
sysdate= 01/06/2020(DD/MM/YYYY)
then new_date_stored = 01/07/2019
FYI: The date format (DD/MM/YYYY vs YYYY-MM-DD) depends on your locale (Region). It’s only a display thing. On my computer, the region is set for the YYYY-MM-DD format.