If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > SQL query yesterday eveytime ran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-20-03, 16:21
jahelstedt jahelstedt is offline
Registered User
 
Join Date: Nov 2003
Posts: 1
SQL query yesterday eveytime ran

I have a report that could be ran automatically everyday if I could figure out how to have SQL query one day before today.

Any thoughts?
Reply With Quote
  #2 (permalink)  
Old 11-20-03, 21:41
arin_am arin_am is offline
Registered User
 
Join Date: Jun 2003
Posts: 34
Can you be MORE EXPLICIT ???

BE MORE EXPLICIT... doesn't make sense to me really
Reply With Quote
  #3 (permalink)  
Old 11-20-03, 22:57
orababa@kshema orababa@kshema is offline
Registered User
 
Join Date: Nov 2003
Location: Bangalore,India
Posts: 51
Re: SQL query yesterday eveytime ran

Quote:
Originally posted by jahelstedt
I have a report that could be ran automatically everyday if I could figure out how to have SQL query one day before today.

Any thoughts?
READ DBMS_JOBS in oracle manual
Reply With Quote
  #4 (permalink)  
Old 11-21-03, 02:23
cvandemaele cvandemaele is offline
Registered User
 
Join Date: Oct 2003
Location: Switzerland
Posts: 140
Re: SQL query yesterday eveytime ran

Quote:
Originally posted by jahelstedt
I have a report that could be ran automatically everyday if I could figure out how to have SQL query one day before today.

Any thoughts?
SYSDATE - 1 RETURNS YESTERDAY'S DATE, AT SAME TIME.
TRUNC(SYSDATE - 1) RETURNS YESTERDAY'S DATE, WITHOUT TIME PART (I.E. MIDNIGHT)

SQL> alter session set nls_date_format = 'DD.MM.YYYY HH24:MIS';

Session altered.

SQL> select sysdate from dual;

SYSDATE
-------------------
21.11.2003 08:32:35

SQL> select sysdate - 1 from dual;

SYSDATE-1
-------------------
20.11.2003 08:32:43

SQL> select trunc(sysdate-1) from dual;

TRUNC(SYSDATE-1)
-------------------
20.11.2003 00:00:00
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On