The first Friday of a month/quarter/year
Example
Write SPL script:
A |
|
1 |
>n=5 |
2 |
=pdate@w(pdate@m(date("2021-05-01"))+6-n)+n |
3 |
=pdate@w(pdate@q(date("2021-05-01"))+6-n)+n |
4 |
=pdate@w(pdate@y(date("2021-05-01"))+6-n)+n |
A1 n represents the day of the week, and Sunday is 0, followed by +1
A2 First use pdate@m to find the first day of the month, then add 6-n days to this day, and then find the Sunday +n days of the date. The result is: 2021-05-07
A3 First use pdate@q to find the first day of the quarter, then add 6-n days to this day, and then find the Sunday +n days of the date. The result is: 2021-04-02
A4 First use pdate@y to find the first day of the year, then add 6-n days to this day, and then find the Sunday +n days of the date. The result is: 2021-01-01
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/
Chinese version