https://randomsrsolutions.blogspot.com/2018/05/using-monthsbetween-in-plsql-query.html
MONTHS_BETWEEN(date1, date2): Finds the number of months between date1 and date2. The result can be positive or negative. If date1 is later than date2, the result is positive; if date1 is earlier than date2, the result is negative . The non-integer part of the result represents a portion of the month.
select MONTHS_BETWEEN('14-AUG-2008','14-AUG-1947') TOT_MONTHS,
MONTHS_BETWEEN('14-AUG-2008','14-AUG-1947')/12 TOT_YEARS,
MONTHS_BETWEEN('14-AUG-2008','14-AUG-1947')*4 TOT_WEEKS,
MONTHS_BETWEEN('14-AUG-2008','14-AUG-1947') *30 TOT_DAYS,
MONTHS_BETWEEN('14-AUG-2008','14-AUG-1947')*30*24 TOT_HOURS
from Dual;
TOT_MONTHS TOT_YEARS TOT_WEEKS TOT_DAYS TOT_HOURS
732 61 2928 21960 527040
Subscribe to:
Post Comments (Atom)
XLA to GL Link
https://plsqlquery.blogspot.com/2025/12/xla-to-gl-link.html SELECT acr.cash_receipt_id, acr.receipt_number, ...
-
https://plsqlquery.blogspot.com/2018/05/using-outer-joins-in-plsql-query.html We use Outer Join when mismatched Values to be displayed ...
-
https://plsqlquery.blogspot.com/2018/05/using-trim-in-plsql-query.html The Oracle/PLSQL TRIM function removes all specified characters eit...
-
https://randomsrsolutions.blogspot.com/2018/05/using-trunc-function-with-numbers-in.html The TRUNC function Truncates the Column, Expressi...
No comments:
Post a Comment