Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> dynamic date with sysdate

dynamic date with sysdate

From: <jpollone_at_primeco.com>
Date: Tue, 12 Jan 1999 21:01:55 GMT
Message-ID: <77gd7m$3br$1@nnrp1.dejanews.com>


Hello,

I am using a third-party product to select records between 2 dynamic dates. In other words I would like one week's worth of records, three weeks ago. Since this is my first attempt with SQL, I am encountering the following error:

ORA-01843: not a valid month

I have also attempted using to_char with sysdate only and still receive the same error. Am I (hopefully) doing something wrong, or could this be a short coming of the third-party query tool?

Thanks,
Joseph Pollone

SQL:

select  Liable_Accounts."LIABLE_ACCT_ID",
        Liable_Accounts."LIABLE_ACCT_OPEN_DT",
        Liable_Accounts."LIABLE_ACCT_CLOSE_DT"

from "PWRMRT1"."LIABLE_ACCOUNTS" Liable_Accounts

where
(
 Liable_Accounts."LIABLE_ACCT_OPEN_DT" between to_char(sysdate - 21, 'YYYY-MM-DD') and to_char(sysdate - 14, 'YYYY-MM-DD') )

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Jan 12 1999 - 15:01:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US