Hello,
I have a table with different dates in a field named DOC_DATE format MM/DD/YYYY.
What I need is to create a new field from DOC DATE, named PAY_DATE, with the next friday to that date.
So I should get something like the following:
DOC_DATE | PAY_DATE |
9/7/2020 | 9/11/2020 |
9/10/2020 | 9/11/2020 |
9/11/2020 | 9/11/2020 |
9/12/2020 | 9/18/2020 |
9/13/2020 | 9/18/2020 |
9/14/2020 | 9/18/2020 |
9/15/2020 | 9/18/2020 |
Is there any way to do that by script?
Thank you!!!
@AleRods88 Assuming your Date Field are in proper date format. You can try below
date(if(WeekDay(DOC_DATE,0)=4,DOC_DATE, WeekEnd(DOC_DATE,0,4)+1)) as PAY_DATE
@AleRods88 Assuming your Date Field are in proper date format. You can try below
date(if(WeekDay(DOC_DATE,0)=4,DOC_DATE, WeekEnd(DOC_DATE,0,4)+1)) as PAY_DATE
Thank you very much! It worked!!!