Connecting Tech Pros Worldwide Help | Site Map

CONVERT() problem

  #1  
Old July 17th, 2008, 02:55 PM
mezzanine1974
Guest
 
Posts: n/a
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, 03:15 PM
Madhivanan
Guest
 
Posts: n/a

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, 03:35 PM
mezzanine1974
Guest
 
Posts: n/a

re: CONVERT() problem


hi Madhivanan,
it is working excellent!
Thanks
  #4  
Old July 28th, 2008, 11:55 AM
Madhivanan
Guest
 
Posts: n/a

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, 05:05 PM
--CELKO--
Guest
 
Posts: n/a

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, 11:25 AM
mezzanine1974
Guest
 
Posts: n/a

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, 07:25 PM
--CELKO--
Guest
 
Posts: n/a

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

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
smalldatetime convert problem dcharnigo answers 4 March 20th, 2008 06:49 PM
void * pointer convert problem. Eric J.Hu answers 23 January 7th, 2006 02:05 PM
ASP 3.0 moved from Win2000 to Win2003 (convert problem) Magnus Lundberg answers 0 December 13th, 2005 03:05 PM
Time convert problem Ralf Meuser answers 3 July 17th, 2005 01:52 PM