473,385 Members | 1,396 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,385 software developers and data experts.

help needed for displaying a numeric value in a aprticular format..URGENT!!

hi,
i have a query which fetches the sum of amounts from a table .the
column is 19 bytes
but the query returns only the actual amount..for example ..it returns
...
-1245.00

but i want it to return all the 19 digits including the zeros and the
sign on the left
-000000000001245.00

plz tell me how this can be odne..its urgent

May 18 '06 #1
6 1343
Raj
do this ...

select digits(c1) from t1

Raj

May 18 '06 #2
In article <11**********************@j33g2000cwa.googlegroups .com>,
sp****@yahoo.com says...
do this ...

select digits(c1) from t1


the digits function will strip of the negative sign. It can be added
with a case statement, something like this:
select case when c1 < 0 then '-' else ' ' end concat digits(c1) from t1
May 18 '06 #3
thx dude.. but it removes the sign and the decimal point also ...is
there any other way this can be done...

May 19 '06 #4
What are you going to do with the result is I guess the question. You
could export it as a dec(19,2) which works fine, or convert it to a
char as in SELECT CHAR(DEC(SUM(C1),19,2)) FROM T1 if it is only going
to be displayed. If it's gonna be used numerically then I don't have an
answer I'm afraid.

May 19 '06 #5
>> but i want it to return all the 19 digits including the zeros and the sign on the left <<

What is the basic prinicple of a tiered architecture? Display is done
in the front end and not in the database. Someone was asleep in class
or really likes to use kludges.

May 19 '06 #6

--CELKO-- wrote:
but i want it to return all the 19 digits including the zeros and the sign on the left <<


What is the basic prinicple of a tiered architecture? Display is done
in the front end and not in the database. Someone was asleep in class
or really likes to use kludges.


Wrong! Display is done where it is most efficient to do it, you need to
consider other scalability parameters - network bandwidth, client spec
etc...

See
http://sqlblogcasts.com/blogs/tonyro...05/11/429.aspx
for a my opinion on this.

Who was asleep in the class on 'developing for a scalable
architecture', that was the class that had practical excercises rather
than just theory!

May 19 '06 #7

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

Similar topics

0
by: Jason | last post by:
Hello. I would like to create a little asp.net web form that will forecast a calendar date based on a user's input. Here's what the input would be like... 1. Select your product - A drop...
7
by: BBFrost | last post by:
I'm receiving decimal values from database queries and placing them on a report page. The users want to see the following .... Db Value Display Value 123.3400 123.34...
3
by: eric_caron_31 | last post by:
Here's my problem, I read numeric value and I want to display this value like this : 123 678. Value read : 123678 Value display : 123 678 I want space for separator thanks for your help
13
by: nishit.gupta | last post by:
Is their any fuction available in C++ that can determine that a string contains a numeric value. The value cabn be in hex, int, float. i.e. "1256" , "123.566" , "0xffff" Thnx
0
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I...
1
by: abhu50 | last post by:
hiiiii i m goin to learn d2k6i so i want to istall it's s/w on my pc,but i could not installed it on my pc b'coz some prblms was occuring as follows:- 1. when i run cd then istaller appeares on...
3
by: kang jia | last post by:
hi, now i want to validate numeric value which user filled in in text box, it can have 2 decimal places. what is the regular expression i can use to achieve this? anyone can help? can reply me...
29
by: MAx | last post by:
Hi, Im kinda stuck in a project at a point where i need an array to be converted to a integer using some kind of math. This board does not support functions like scanf, sscanf etc as it does not...
1
by: mik357 | last post by:
Hello all, I just started using SQL to create a report. I got the syntax working but I have absolutely no idea of how to format data. Can anyone kindly look at my code and help me? I thank you...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.