How to format the results of subtrcating a date to show only two decimals

maximus1974
maximus1974 used Ask the Experts™
on
As you can see form the attachment, my results are more than two decimal places for DAYS_SINCE_REVIEW. How can I cast this column two display only the first two decimals? ex. 30 not 30.79595864855

Current SQL:
select
WO_NUMBER
, CUSTOMER_PO
, CUSTOMER_NAME
, CUSTOMER_CODE
, CSM
, DEPT_NAME SHOP
, PN
, SERIAL_NUMBER
, DESCRIPTION
, ENTRY_DATE WO_CREATION
, STATUS WO_STATUS
, ENTRY_DATE + 5 as ESTIMATED_QUOTE_DATE
, LAST_QUOTE_SENT
, LAST_QUOTE_STATUS QUOTE_STATUS
, LAST_QUOTE_APPROVED
, LAST_QUOTE QUOTE_NUMBER
, QUOTED_AMOUNT
, SHIP_DATE as ESTIMATED_SHIP_DATE
, LAST_QUOTE_SENT - ENTRY_DATE AS DAYS_SINCE_REVIEW
FROM ba_view_wo_summary
where syscm_auto_key=1 and pbh_customer='N' and status not in ('CLOSED','CANCELLED','CLS INVOICE') and dept_name not like '%GSE%'
order by due_date asc

Open in new window



Thank you
Capture.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2012
Commented:
floor(LAST_QUOTE_SENT - ENTRY_DATE) AS DAYS_SINCE_REVIEW

or

trunc(LAST_QUOTE_SENT - ENTRY_DATE) AS DAYS_SINCE_REVIEW

for non-negative numbers there is no functional difference between these two options.

if you might have negative numbers, then you'll probably want the TRUNC instead of FLOOR

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial