Functions to use instead of to_char in SQL Server 2000

  • Hi,

    I need to change the following oracle statement equivalent in SQL Server 2000.Please help me

    substr(to_char(fee.rollno,1,2)=substr(to_char(batchcode),1,2)

  • Use CAST or CONVERT for to_char to convert data to strings.

  • Can u please tell me how to convert it exactly

  • anitha.chacko (12/7/2010)


    Can u please tell me how to convert it exactly

    http://msdn.microsoft.com/en-us/library/ms187928.aspx

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • I don't know exactly what to_char will do on Oracle, so no, I can't. I have pointed you to the similar commands, and there is a link from someone to help you work through it.

    SUBSTRING in SQL Server will get part of a string. CAST will change the type to a character. I assume they are drop in replacements for that code, but YOU have to test it and make sure it acts as you expect.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply