October 27, 2003 at 10:23 am
How can i write 13445 as 13,445 and 13444444 as 13,444,444 and 1345 as 1,345.
Thanks,
Hari
October 27, 2003 at 10:39 am
Use the formatting capability of your front-end language.
--Jonathan
--Jonathan
October 27, 2003 at 11:57 am
Well to get exactly what you are looking for will take some extra work.
But if 123,456.78 is OK try this
Convert(Char(20), CAST(SUM(Loss_Disb_Amt) AS Money), 1) AS "Loss Disbursement"
You won't need the inner CAST to money if your field is already defined as Money.
I think you could "LEFT( above, 17)" to eliminate the decimals.
KlK, MCSE
KlK
October 28, 2003 at 2:07 am
Hi hari,
hope this solves your problem:
declare @x money
set @x = 13445
select convert(char(10),@x,1)
Output is: 13,445.00
quote:
How can i write 13445 as 13,445 and 13444444 as 13,444,444 and 1345 as 1,345.Thanks,
Hari
October 28, 2003 at 5:16 am
quote:
Well to get exactly what you are looking for will take some extra work.But if 123,456.78 is OK try this
Convert(Char(20), CAST(SUM(Loss_Disb_Amt) AS Money), 1) AS "Loss Disbursement"
You won't need the inner CAST to money if your field is already defined as Money.
I think you could "LEFT( above, 17)" to eliminate the decimals.
KlK, MCSE
Or so you can have a non-specific length try
LEFT(result, LEN(result) - 3)
then sub varchar in palce of char and ive a large enough size for the data.
October 28, 2003 at 5:20 am
I'll stick with Jonathan's suggestion.
That's job of the client app, not the server.
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
October 28, 2003 at 6:28 am
My front end is Access. If I am displaying the number in a list box I cannot use the formatting capability of Access, I have to use the language suggested by kknudson.
October 28, 2003 at 6:38 am
You can use an Access query as source for your list box.
Within the Access Query designer you are able to right-click on your column and choose format. There you should find every format you need.
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply