• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 54
  • Last Modified:

How to add 5 days to a date field in Oracle

I have the following statement and I want to add +5 days to ENTRY_DATE column(last column).

select
WO_NUMBER
, CUSTOMER_PO
, CUSTOMER_NAME
, CUSTOMER_CODE
, PBH_CUSTOMER
, CSM
, DEPT_NAME SHOP
, PN
, DESCRIPTION
, ENTRY_DATE WO_CREATION
, STATUS
, DUE_DATE
, MANUAL_ECD ECD
, FIRST_QUOTE_SENT
, LAST_QUOTE_APPROVED
, LAST_QUOTE QUOTE_NUMBER
, LAST_QUOTE_STATUS QUOTE_STATUS
, QUOTED_AMOUNT
, DECODE(WARRANTY_GRANTED,'T','Y','N') WARRANTY_GRANTED
, [b]ENTRY_DATE[/b]
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

0
maximus1974
Asked:
maximus1974
1 Solution
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
You can indeed just add 5 to the value. You can add " days" to the expression (as text) to make clear what you want to do. So Entry_date+5 and Entry_date + 5 days should work.
0
 
maximus1974Author Commented:
Pardon my ignorance with oracle. the syntax will be:
 
select
WO_NUMBER
, CUSTOMER_PO
, CUSTOMER_NAME
, CUSTOMER_CODE
, PBH_CUSTOMER
, CSM
, DEPT_NAME SHOP
, PN
, DESCRIPTION
, ENTRY_DATE WO_CREATION
, STATUS
, DUE_DATE
, MANUAL_ECD ECD
, FIRST_QUOTE_SENT
, LAST_QUOTE_APPROVED
, LAST_QUOTE QUOTE_NUMBER
, LAST_QUOTE_STATUS QUOTE_STATUS
, QUOTED_AMOUNT
, DECODE(WARRANTY_GRANTED,'T','Y','N') WARRANTY_GRANTED
, ENTRY_DATE+5 AS TARGET_DATE
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

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now