mysql date woes help help help help

Discussion in 'MySQL' started by arunsuriindia, Mar 2, 2007.

  1. #1
    below is the ouput of my select query

    'AARTIDRUGS', 'EQ', 68.00, 68.00, 63.55, 64.15, 63.75, 67.20, 8452.00, 549542.85, '22-Feb-07


    the last column which appears to be date is varchar(45)

    i want to convert this last column into date format of my sql and insert in a different table.

    i want a select query

    and update query
     
    arunsuriindia, Mar 2, 2007 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mad4, Mar 2, 2007 IP
  3. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    its a way but i want a simpler way by which i can do it

    i want the qrey statemnets also written
     
    arunsuriindia, Mar 2, 2007 IP
  4. spachev

    spachev Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    use a combination of substring() and case when then when then ... to create an expression to parse your date. You need to covert the date to the YYYY-MM-DD format string, then MySQL will recognize it. Read MySQL manual on those functions for more info.
     
    spachev, Mar 8, 2007 IP
  5. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yeah thats what i did

    thanx
     
    arunsuriindia, Mar 8, 2007 IP