Reply to SQL Format Function "0000"

Your name:

Reply:


Posted by duprejonathan on 02/12/07 14:38

Hello, i don't know how to format a string with an SQL select query
for my VB6 App.

I have a table like this :
Code - Name
1 - Jonathan
2 - Mike
....
9 - Claudia
10 - Robbie
11 - Sandy

But I would get code column result's with a particular format like
this :

0001 - Jonathan
0002 - Mike
....
0009 - Claudia
0010 - Robbie
0011 - Sandy

I use the Format(column, "#0000") function in my application ffor the
moment but nothing to do with the DB Engine side ???

I tried CONVERT function :
SELECT CONVERT(varchar(4), code, '0000') FROM Employes;
But the code result's stil 1,2,3 and not 0001,0002,0003 !!!

Anyone has the solution ?

Thanks

Jonathan

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация