SELECT DECODE
(books.period_counter_fully_ retired,
NULL, GREATEST
( NVL (books.life_in_months, 0)
- TRUNC
(MONTHS_BETWEEN (SYSDATE,
books.date_placed_in_service
)
),
0
),
0
) remaining_life_in_months,
DECODE
(books.period_counter_fully_ retired,
NULL, TRUNC
( GREATEST
( NVL (books.life_in_months, 0)
- TRUNC
(MONTHS_BETWEEN (SYSDATE,
books.date_placed_in_service
)
),
0
)
/ 12
),
0
) remaining_life_in_years,
asset_id
FROM fa_books books
WHERE asset_id=100036-- Pass your assest
thanks
ReplyDelete