Is This Possible? 
Author Message
 Is This Possible?
is it possible to convert integer to char with fix lenght i want in SQL.
Something like
sprintf(data,"%d08",intNumber) in C++?

Example : 898 to "00000898"

--
Regards,
Jonathan Chong
Easy Multimedia Sdn Bhd



Mon, 28 Jan 2002 03:00:00 GMT
 Is This Possible?

This is indeed possible by using the replicate function

See my code library article
www.sql-server.co.uk\codelibrary\programming\13.htm

--
Tony Rogerson MCP, SQL Server MVP
Torver Computer Consultants Ltd.

www.sql-server.co.uk [Code/Examples library + Neil Pike's FAQ]


Quote:
> is it possible to convert integer to char with fix lenght i want in SQL.
> Something like
> sprintf(data,"%d08",intNumber) in C++?

> Example : 898 to "00000898"

> --
> Regards,
> Jonathan Chong
> Easy Multimedia Sdn Bhd



Mon, 28 Jan 2002 03:00:00 GMT
 Is This Possible?

        Right( '00000000' + Ltrim( Str( intNumber ) ), 8 )

        Vladimir Tumanov,
        Novosibirsk? Russia

         ------------------------------

Quote:
> is it possible to convert integer to char with fix lenght i want in
> SQL.
> Something like
> sprintf(data,"%d08",intNumber) in C++?

> Example : 898 to "00000898"

> --
> Regards,
> Jonathan Chong
> Easy Multimedia Sdn Bhd



Mon, 28 Jan 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Is this possible, or am I pushing it?

2. Is this Possible Using DTS?Could you say the details.I am new

3. error ORA-01855: AM/A.M. or PM/P.M. required

4. Busy Day = Slowdown from 12 AM - 5 AM

5. Use of @am, Am I dumb?

6. I am getting this message when i am tring to export or import anything using

7. I need to test whether I am getting a result back from a query is it possible?

8. Hi, I am stuck.When I submit the form, I am not sure what exactly have been submitted.

9. Webcast Reminder -- The Value of Informix & Tivoli - Thursday, October 24, 8:00 AM Pacific / 11:00 AM Eastern

10. Am installing a store on NT4 and SQL7sp1 and am getting this message...when trying to access..

11. I am a pain in the butt, however I am learning !

12. Linked Servers Help I am going crazy


 
Powered by phpBB® Forum Software