Home » SQL & PL/SQL » SQL & PL/SQL » How to minus 1 day
How to minus 1 day [message #601462] Thu, 21 November 2013 05:26 Go to next message
sahnra
Messages: 39
Registered: November 2013
Location: India
Member
How i can subtract one day from sysdate, so that A.effect_date will retrive date of one day before sysdate.

For example
Today date 20/11/2013
data will retrive of yesterday

Select A.Employee EEID, C.first_name||''||C.last_name EE_Name, c.Fica_NBR SSN,  b.EBANK_ID Routing,
b.ebnk_ACCT_NBR Account, b.Description Bank_name,
A.effect_date , b.ACH_Prenotify Prenotify_Status,C.process_level,
D.National_name
from PERSACTION A, emachdepst b, Employee c, comprof D where a.employee = b.employee
and a.company= b.company
and a.employee=c.employee
and a.company = c.company
and c.process_level = d.process_level
and c.company = d.company
and A.Action_code = 'DIRECT DEP'
and A.effect_date = 

[Updated on: Thu, 21 November 2013 05:27]

Report message to a moderator

Re: How to minus 1 day [message #601464 is a reply to message #601462] Thu, 21 November 2013 05:37 Go to previous messageGo to next message
John Watson
Messages: 8927
Registered: January 2010
Location: Global Village
Senior Member
orclz>
orclz> select sysdate,sysdate-1 from dual;

SYSDATE             SYSDATE-1
------------------- -------------------
2013-11-21 11:35:45 2013-11-20 11:35:45

orclz>
you will need either to use a BETWEEN predicate, or to apply a TRUNCATE to remove the time element.
Re: How to minus 1 day [message #601466 is a reply to message #601464] Thu, 21 November 2013 05:54 Go to previous message
sahnra
Messages: 39
Registered: November 2013
Location: India
Member
Thanks Woking for Me
Previous Topic: Please Suggest in this query what should i do..
Next Topic: sql
Goto Forum:
  


Current Time: Tue Apr 16 00:10:59 CDT 2024