dbTalk Databases Forums  

Error with implicit date calculation

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Error with implicit date calculation in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
William Robertson
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-22-2008 , 11:44 AM






On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Quote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org
Or the handy ANSI format for date literals:

DATE '1998-12-07'


Reply With Quote
  #22  
Old   
news.verizon.net
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-22-2008 , 11:19 PM







"William Robertson" <williamr2019 (AT) googlemail (DOT) com> wrote

Quote:
On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'
I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim




Reply With Quote
  #23  
Old   
news.verizon.net
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-22-2008 , 11:19 PM




"William Robertson" <williamr2019 (AT) googlemail (DOT) com> wrote

Quote:
On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'
I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim




Reply With Quote
  #24  
Old   
news.verizon.net
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-22-2008 , 11:19 PM




"William Robertson" <williamr2019 (AT) googlemail (DOT) com> wrote

Quote:
On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'
I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim




Reply With Quote
  #25  
Old   
news.verizon.net
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-22-2008 , 11:19 PM




"William Robertson" <williamr2019 (AT) googlemail (DOT) com> wrote

Quote:
On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'
I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim




Reply With Quote
  #26  
Old   
William Robertson
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-25-2008 , 02:26 AM



On Feb 23, 5:19 am, "news.verizon.net" <kenned... (AT) verizon (DOT) net> wrote:
Quote:
"William Robertson" <williamr2... (AT) googlemail (DOT) com> wrote in message

news:73d6ee2e-eb65-4ffb-92e8-4179dccc127d (AT) q78g2000hsh (DOT) googlegroups.com...



On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'

I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim
What exactly isn't clear about ANSI date literals? They are
unambiguous, compact and language-independent. I would strongly
recommend using them.


Reply With Quote
  #27  
Old   
William Robertson
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-25-2008 , 02:26 AM



On Feb 23, 5:19 am, "news.verizon.net" <kenned... (AT) verizon (DOT) net> wrote:
Quote:
"William Robertson" <williamr2... (AT) googlemail (DOT) com> wrote in message

news:73d6ee2e-eb65-4ffb-92e8-4179dccc127d (AT) q78g2000hsh (DOT) googlegroups.com...



On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'

I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim
What exactly isn't clear about ANSI date literals? They are
unambiguous, compact and language-independent. I would strongly
recommend using them.


Reply With Quote
  #28  
Old   
William Robertson
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-25-2008 , 02:26 AM



On Feb 23, 5:19 am, "news.verizon.net" <kenned... (AT) verizon (DOT) net> wrote:
Quote:
"William Robertson" <williamr2... (AT) googlemail (DOT) com> wrote in message

news:73d6ee2e-eb65-4ffb-92e8-4179dccc127d (AT) q78g2000hsh (DOT) googlegroups.com...



On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'

I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim
What exactly isn't clear about ANSI date literals? They are
unambiguous, compact and language-independent. I would strongly
recommend using them.


Reply With Quote
  #29  
Old   
William Robertson
 
Posts: n/a

Default Re: Error with implicit date calculation - 02-25-2008 , 02:26 AM



On Feb 23, 5:19 am, "news.verizon.net" <kenned... (AT) verizon (DOT) net> wrote:
Quote:
"William Robertson" <williamr2... (AT) googlemail (DOT) com> wrote in message

news:73d6ee2e-eb65-4ffb-92e8-4179dccc127d (AT) q78g2000hsh (DOT) googlegroups.com...



On Feb 20, 11:29 pm, DA Morgan <damor... (AT) psoug (DOT) org> wrote:
Arch wrote:
I need a hand with SQL. I'm using 9.2.0.4.

I need to compute a date offset by a number of weeks from another
date. This is a line from a view that I had been using:

TO_DATE('7-Dec-1998') + (WeekNum * 7) As WeekDate

WeekNum is, of course, the field that contains the number of weeks to
offset from the date. This used to work just fine - it doesn't any
longer. The TO_DATE function now returns the error:

ORA_1858 a non-numeric character was found where a
numeric character was expected

If I change it to TO_DATE('7-Dec-2000') or any later date, it no
longer gives an error. It does not return the desired value, of
course, but no error. Any date 1999 or earlier causes the error.

I would appreciate any advice how to correct this.

It would likely help if you used the full syntax:

TO_DATE('07-DEC-1998', 'DD-MON-RRRR')
or
TO_DATE('07-DEC-1998', 'DD-MON-YYYY')
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damor...@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Groupwww.psoug.org

Or the handy ANSI format for date literals:

DATE '1998-12-07'

I wouldn't do that. Use the to_date function with explicit specification
for the format you are using. It makes it very clear what you are trying to
do; in a way it documents how you want it converted. Much easier to
maintain.
Jim
What exactly isn't clear about ANSI date literals? They are
unambiguous, compact and language-independent. I would strongly
recommend using them.


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.