sql related to date in oracle 10g

Discussion in 'Databases' started by priynk19, Oct 26, 2010.

  1. #1
    I was running this sql in oracle

    select * from premium_reg where date_end <= '25/11/2010'

    I got an error
    Not a valid month

    What is the right sql?
     
    priynk19, Oct 26, 2010 IP
  2. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    first you use this
    select date_end from premium_reg;

    have a careful look at the date format and use accordingly.

    Usually oracle uses this date format:
    Select* from premium_reg where date_end <= '25-Nov-2010';
     
    alfa_375, Oct 26, 2010 IP
  3. priynk19

    priynk19 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok..thank u..
     
    priynk19, Oct 27, 2010 IP
  4. seotraining

    seotraining Active Member

    Messages:
    511
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    70
    #4
    There should be some problem in date format even you can try this

    select * from premium_reg where date_end <= '11/25/2010'
     
    seotraining, Oct 27, 2010 IP
  5. jonnywartin

    jonnywartin Peon

    Messages:
    240
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I do not understand very well may explain a little?
     
    jonnywartin, Nov 30, 2010 IP
  6. sandy121

    sandy121 Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It is quite normal . By default, Oracle uses mm/dd/yyyy format.
     
    sandy121, Dec 1, 2010 IP
  7. makaleus

    makaleus Peon

    Messages:
    264
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    select * from premium_reg where date_end list<= '25/11/2010';
    mysql_query
     
    makaleus, Dec 1, 2010 IP
  8. Little Honey

    Little Honey Peon

    Messages:
    127
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    This is correct. Putting the month first is the US convention. Most of the rest of the world puts the day first. I wonder if there is a way to change the default?
     
    Little Honey, Dec 13, 2010 IP