Hello NishimuraChinatsu-9854, I don't think we can use INTERVAL here. SELECT FORMAT((DATEADD(year, -1, GETUTCDATE())), 'yyyy/MM/dd') The above query will return the date that was one year ago from the current date in the format yyyy/MM/dd To set the date of delivery after January 1 of the previous year, you can modify the DATEADD() function to subtract one year and add one day to get January 1 of the previous year. SELECT FORMAT((DATEADD(day, 1, DATEADD(year, -1, DATEFROMPARTS(YEAR(GETUTCDATE()), 1, 1)))),'yyyy/MM/dd') This query will return January 1 of the previous year in the format yyyy/MM/dd. You can modify the DATEFROMPARTS() function to get the year of the date you want to set the delivery date for.
I am getting an error in VIEW, what is the solution?
NishimuraChinatsu-9854
756
Reputation points
I am getting an error in VIEW, what is the solution? I would like to set the date of delivery after January 1 of the previous year.
Accepted answer
-
Bhargava-MSFT 29,266 Reputation points Microsoft Employee
2023-04-07T20:31:44.85+00:00