April 25, 2003 at 12:57 am
I have managed to calculate the sum of the length but the it displays this..
2.49084932
What must I do to display the result only in 2 decimal points?
example : 2.49
Thanks
eat when you can and not when you cannot.
eat when you can and not when you cannot.
April 25, 2003 at 1:04 am
Try this:
select convert(decimal(10,2),2.49084932)
Jeremy
April 25, 2003 at 1:10 am
hey there,
I tried your method, but it doesn't seem to work.
SUM(d.length)/1000 AS LENGTH
should I be doing this?
convert(decimal(10,2)sum(d.length)/1000)) as length?
while I am at it, have to i have multiple 'between's'??
example : i want to display id's between this numbers
15-20, 30-40 and 50-60
only id's within this range. How do I include this in my sql query?
i am very new at this
eat when you can and not when you cannot.
eat when you can and not when you cannot.
April 25, 2003 at 1:29 am
Hi,
with a small correction in the typo
convert(decimal(10,2), sum(d.length)/1000)) as length
that should work
to display the range try a WHERE field BETWEEN <low> AND <high>
or WHERE field > <low> AND field < <high>
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
April 25, 2003 at 4:00 am
You should use CAST instead of CONVERT this is where MS is going with things.
CAST((sum(d.length)/1000) AS decimal(10,2))
April 27, 2003 at 6:49 pm
hey thanks Antares686
that worked well. thanks so much guys
eat when you can and not when you cannot.
eat when you can and not when you cannot.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply