Connecting Tech Pros Worldwide Help | Site Map

CONVERT() problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2008, 01:55 PM
mezzanine1974
Guest
 
Posts: n/a
Default CONVERT() problem

In access query, i can use following expression to show "AnyInteger"
in the format of "0000"

CStr(Format(AnyInteger,"0000"))

eg:
12 yields to 0012
8 yields to 0008

how should i use CONVERT() function in SQL SERVER to achive my goal
please?


  #2  
Old July 17th, 2008, 02:15 PM
Madhivanan
Guest
 
Posts: n/a
Default Re: CONVERT() problem

On Jul 17, 6:54*pm, mezzanine1974 <savas_karadu...@yahoo.comwrote:
Quote:
In access query, i can use following expression to show "AnyInteger"
in the format of "0000"
>
CStr(Format(AnyInteger,"0000"))
>
eg:
12 yields to 0012
8 yields to 0008
>
how should i use CONVERT() function in SQL SERVER to achive my goal
please?

Formation matters only if you want to show them in front end
application. Otherwise use

Select right('0000'+cast(anyinteger as varchar(4)),4)
  #3  
Old July 17th, 2008, 02:35 PM
mezzanine1974
Guest
 
Posts: n/a
Default Re: CONVERT() problem

hi Madhivanan,
it is working excellent!
Thanks
  #4  
Old July 28th, 2008, 10:55 AM
Madhivanan
Guest
 
Posts: n/a
Default Re: CONVERT() problem

On Jul 17, 7:31*pm, mezzanine1974 <savas_karadu...@yahoo.comwrote:
Quote:
hi Madhivanan,
it is working excellent!
Thanks

You are welcome [:)]
  #5  
Old July 28th, 2008, 04:05 PM
--CELKO--
Guest
 
Posts: n/a
Default Re: CONVERT() problem

In a tiered architecture, formatting and display are done in the front
end and not the database.

You will need about a year to UN-learn ACCESS (monolithic single user
desktop design) and start writing SQL (tiered, multi-user, client
server).


  #6  
Old August 25th, 2008, 10:25 AM
mezzanine1974
Guest
 
Posts: n/a
Default Re: CONVERT() problem

You will need about a year to UN-learn ACCESS (monolithic single user
Quote:
desktop design)
It sounds to me very dramatical (


  #7  
Old August 25th, 2008, 06:25 PM
--CELKO--
Guest
 
Posts: n/a
Default Re: CONVERT() problem

>It sounds to me very dramatic <<

No, that estimate of a year of un-learning is based on being involved
with the ANSI/ISO Standards, teaching SQL and RDBMS for a few decades,
and writing eight books on the topic.

"Perfecting oneself is as much unlearning as it is learning." --
Edsger Dijkstra

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.