SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 11th, 2003, 03:18 PM
xChris xChris is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 xChris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dates in Oracle

Advise, please on comparing dates in Oracle SQL. Previously operational code:

(accs.EVENT_DT>'5/18/1992')

now throws this error:

ERROR: ORA-01843: not a valid month

accs.EVENT_DT is a field of type DATE and SQL-Plus displays it like 10-Sep-03

I'm thinking that I need to express the date to which I want to compare accs.EVENT_DT properly. That is to say I need to convert 5/18/1992 (in this example) to a properly formated date expression.

Any ideas?

Reply With Quote
  #2  
Old September 30th, 2003, 10:50 AM
gregory.owen@hp's Avatar
gregory.owen@hp gregory.owen@hp is offline
Maniac
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Sweet Home, Oregon
Posts: 548 gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level)gregory.owen@hp User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 4 h 37 m 8 sec
Reputation Power: 14
I'm not an oracle expert, but sql server has a function called CAST() which you could use to force your char data to datetime. You might look at your oracle docs to see if there is something similar.

Reply With Quote
  #3  
Old October 7th, 2003, 12:36 PM
m_lazor m_lazor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Luxembourg
Posts: 156 m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level)m_lazor User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Could also be that your ORA is configured for a date format other than mm/dd/yyyy

Reply With Quote
  #4  
Old February 13th, 2004, 12:32 PM
cloti cloti is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 cloti User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it's sure that your oracle is set to the format dd/mm/yyyy

Prove to use (accs.EVENT_DT>to_date('05/18/1992','mm/dd/yyyy')

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Dates in Oracle


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT