473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

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?

Jul 17 '08 #1
6 1449
On Jul 17, 6:54*pm, mezzanine1974 <savas_karadu...@yahoo.comwrote:
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)
Jul 17 '08 #2
hi Madhivanan,
it is working excellent!
Thanks
Jul 17 '08 #3
On Jul 17, 7:31*pm, mezzanine1974 <savas_karadu...@yahoo.comwrote:
hi Madhivanan,
it is working excellent!
Thanks

You are welcome [:)]
Jul 28 '08 #4
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).
Jul 28 '08 #5
You will need about a year to UN-learn ACCESS (monolithic single user
desktop design)
It sounds to me very dramatical (
Aug 25 '08 #6
>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

Aug 25 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
by: Sam Smith | last post by:
Hi, I wan't a function to take a const char*, a start bit position and number of bits and convert that bit-stream into a primitive of desired type. I.e. something like: char convert(const...
4
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
4
by: Rodusa | last post by:
I am having problem to apply updates into this function below. I tried using cursor for updates, etc. but no success. Sql server keeps telling me that I cannot execute insert or update from inside...
4
by: Irepan | last post by:
does anybody know how to change the global IFormatProvider of my project so everycall to Convert.ToDouble on it uses this format provider instead of the one the one on the computer's regional...
4
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
1
by: vipin | last post by:
My C# console application takes 5 parameters two of which are supposed to be inherently integers So I do COnvert.ToInt32(args) There is no problem with the console application when I run it...
6
by: Ricardo Quintanilla | last post by:
i have a code that sends data to a socket listening over as400 platform, the socket responds to me as a "byte array". then i need to convert the "byte array" into a string. the problem is that...
12
by: Wolfgang Kaml | last post by:
Dear all, I am using the following code to retrieve the size of a certain file and the available (free) space on the disk. The problem is, that I get the size of the file returned as a Long and...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.