Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2012

    Unanswered: to_date in sybase

    Hi all ..

    i need a to_date equivalent function in sybase.
    For ex :

    select to_date(02, 'MM') from dual

    In oracle above select returns '2013-02-01 00:00:00.0'

    Its taking the given string as a month and displays it in timestamp format

    Can anyone tell me how can i get the same result in sybase IQ?
    i tried out many date functions in sybase iq, but i could not get this

    pls help me out, thanks in advance !!

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Due to the fundamentally different way that Oracle thinks about dates, I doubt that there is any other database that has a function that works like Oracle's TO_DATE function does.

    Due to the complexity of Oracle's date handling logic, I can see what you are doing using the Oracle syntax but I can't see why you are doing it. You could be doing date pre-processing (which isn't necessary or possible in ASE). You might be doing band matching, which doesn't even make sense outside of Oracle. You might be using TO_DATE as a form of cryptographic function. Because I can see the what but not the why, I can't offer a suggestion for how to translate the Oracle example to another database (in part because no translation may be needed or possible).

    I'd be happy to help if I could, but would need more understanding before I can even guess at what you want!

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Nov 2012
    am migrating a system from oracle to sybase DB.. there is no wat that they will change the input format

    till now in oracle for a column they were doing this kind of transformation.. so i need 2 do the same functionality with same input data in sybase ..

    thanks for ur response i 2 tried hard in sybase but flopped..

    atlast some 15 mins bac i framed a poor sql 4 sybase like below :

    select trim(convert(char,year(getdate())))+'-'+'02'+'-'+'01'+' 00:00:00.0'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts