Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    1

    Unanswered: 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?

  2. #2
    Join Date
    Jun 2003
    Posts
    34

    Can you be MORE EXPLICIT ???

    BE MORE EXPLICIT... doesn't make sense to me really

  3. #3
    Join Date
    Nov 2003
    Location
    Bangalore,India
    Posts
    51

    Re: SQL query yesterday eveytime ran

    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

  4. #4
    Join Date
    Oct 2003
    Location
    Switzerland
    Posts
    140

    Re: SQL query yesterday eveytime ran

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •