Saturday, May 5, 2018

Using NEXT_DAYin PLSQL Query



NEXT_DAY(date, 'char'): Finds the date of the next specified day of the week ('char') following date. The value of char may be a number representing a day or a character string.

What was the first Thursday, Friday, Saturday & Sunday after August 14, 1947

select
NEXT_DAY('14-AUG-1947','THURSDAY') FIRST_THU,
NEXT_DAY('14-AUG-1947','FRIDAY') FIRST_FRI,
NEXT_DAY('14-AUG-1947','SATURDAY') FIRST_SAT,
NEXT_DAY('14-AUG-1947','SUNDAY') FIRST_SUN
from dual;

FIRST_THU     FIRST_FRI     FIRST_SAT     FIRST_SUN
 21-AUG-47       15-AUG-47      16-AUG-47       17-AUG-47

No comments:

Post a Comment

XLA to GL Link

  https://plsqlquery.blogspot.com/2025/12/xla-to-gl-link.html SELECT             acr.cash_receipt_id,             acr.receipt_number,       ...