Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
decimals after the period - i.e. 144.55? When I create the column in EM with
the smallmoney datatype, the precision field is grayed out. Isn't there some
way to put a format code like "####.##" somewhere?
Thanks,
--
Dan D.Hi Dan
"Dan D." wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
2
> decimals after the period - i.e. 144.55? When I create the column in EM wi
th
> the smallmoney datatype, the precision field is grayed out. Isn't there so
me
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
SQL Server will stored smallmoney with 4 decimal places regardless,
formatting output should be done on the client.
John|||Dan
DECIMAL(5,2) or NUMERIC datatypes
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:01B59869-B53E-4442-97AB-94B376C26390@.microsoft.com...
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
> 2
> decimals after the period - i.e. 144.55? When I create the column in EM
> with
> the smallmoney datatype, the precision field is grayed out. Isn't there
> some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.|||On 7 May, 14:21, Dan D. <D...@.discussions.microsoft.com> wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
2
> decimals after the period - i.e. 144.55? When I create the column in EM wi
th
> the smallmoney datatype, the precision field is grayed out. Isn't there so
me
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
Use DECIMAL/NUMERIC. Avoid MONEY or SMALLMONEY for currency values,
there are two many problems associated with the money types.
Do remember that SQL Server has no real control over how numeric
values are displayed. In all cases it is your client software that
determines display formatting, not SQL Server.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--sql
Showing posts with label decimals. Show all posts
Showing posts with label decimals. Show all posts
Friday, March 23, 2012
formatting smallmoney to 2 decimals
Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
decimals after the period - i.e. 144.55? When I create the column in EM with
the smallmoney datatype, the precision field is grayed out. Isn't there some
way to put a format code like "####.##" somewhere?
Thanks,
Dan D.
Hi Dan
"Dan D." wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
SQL Server will stored smallmoney with 4 decimal places regardless,
formatting output should be done on the client.
John
|||Dan
DECIMAL(5,2) or NUMERIC datatypes
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:01B59869-B53E-4442-97AB-94B376C26390@.microsoft.com...
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
> 2
> decimals after the period - i.e. 144.55? When I create the column in EM
> with
> the smallmoney datatype, the precision field is grayed out. Isn't there
> some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
|||On 7 May, 14:21, Dan D. <D...@.discussions.microsoft.com> wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
Use DECIMAL/NUMERIC. Avoid MONEY or SMALLMONEY for currency values,
there are two many problems associated with the money types.
Do remember that SQL Server has no real control over how numeric
values are displayed. In all cases it is your client software that
determines display formatting, not SQL Server.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
decimals after the period - i.e. 144.55? When I create the column in EM with
the smallmoney datatype, the precision field is grayed out. Isn't there some
way to put a format code like "####.##" somewhere?
Thanks,
Dan D.
Hi Dan
"Dan D." wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
SQL Server will stored smallmoney with 4 decimal places regardless,
formatting output should be done on the client.
John
|||Dan
DECIMAL(5,2) or NUMERIC datatypes
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:01B59869-B53E-4442-97AB-94B376C26390@.microsoft.com...
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
> 2
> decimals after the period - i.e. 144.55? When I create the column in EM
> with
> the smallmoney datatype, the precision field is grayed out. Isn't there
> some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
|||On 7 May, 14:21, Dan D. <D...@.discussions.microsoft.com> wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
Use DECIMAL/NUMERIC. Avoid MONEY or SMALLMONEY for currency values,
there are two many problems associated with the money types.
Do remember that SQL Server has no real control over how numeric
values are displayed. In all cases it is your client software that
determines display formatting, not SQL Server.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
formatting smallmoney to 2 decimals
Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
decimals after the period - i.e. 144.55? When I create the column in EM with
the smallmoney datatype, the precision field is grayed out. Isn't there some
way to put a format code like "####.##" somewhere?
Thanks,
--
Dan D.Hi Dan
"Dan D." wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
SQL Server will stored smallmoney with 4 decimal places regardless,
formatting output should be done on the client.
John|||Dan
DECIMAL(5,2) or NUMERIC datatypes
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:01B59869-B53E-4442-97AB-94B376C26390@.microsoft.com...
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
> 2
> decimals after the period - i.e. 144.55? When I create the column in EM
> with
> the smallmoney datatype, the precision field is grayed out. Isn't there
> some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.|||On 7 May, 14:21, Dan D. <D...@.discussions.microsoft.com> wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
Use DECIMAL/NUMERIC. Avoid MONEY or SMALLMONEY for currency values,
there are two many problems associated with the money types.
Do remember that SQL Server has no real control over how numeric
values are displayed. In all cases it is your client software that
determines display formatting, not SQL Server.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
decimals after the period - i.e. 144.55? When I create the column in EM with
the smallmoney datatype, the precision field is grayed out. Isn't there some
way to put a format code like "####.##" somewhere?
Thanks,
--
Dan D.Hi Dan
"Dan D." wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
SQL Server will stored smallmoney with 4 decimal places regardless,
formatting output should be done on the client.
John|||Dan
DECIMAL(5,2) or NUMERIC datatypes
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:01B59869-B53E-4442-97AB-94B376C26390@.microsoft.com...
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only
> 2
> decimals after the period - i.e. 144.55? When I create the column in EM
> with
> the smallmoney datatype, the precision field is grayed out. Isn't there
> some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.|||On 7 May, 14:21, Dan D. <D...@.discussions.microsoft.com> wrote:
> Using SS2000 SP4. Is there anyway to default the smallmoney column to only 2
> decimals after the period - i.e. 144.55? When I create the column in EM with
> the smallmoney datatype, the precision field is grayed out. Isn't there some
> way to put a format code like "####.##" somewhere?
> Thanks,
> --
> Dan D.
Use DECIMAL/NUMERIC. Avoid MONEY or SMALLMONEY for currency values,
there are two many problems associated with the money types.
Do remember that SQL Server has no real control over how numeric
values are displayed. In all cases it is your client software that
determines display formatting, not SQL Server.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
Wednesday, March 21, 2012
Formatting in sql query
Hello All,
Is it possible to format an integer to a float value with 2 decimals in an sql query.
If yes, Please help?
SELECT
CONVERT(DECIMAL(4,2),9)You can replace number 9 above with your integer or integer column.
|||Thanks Limno,
You are a life saver.
Monday, March 12, 2012
Formating numbers
I have a number 600.00 and would like to format it to look like 600 (no
decimals). How do I do that?Hi Donna,
If you want the number to round up use FormatNumber({your number},0)
If you want just what is left of the decimal use Floor({your number})
"DONNA" wrote:
> I have a number 600.00 and would like to format it to look like 600 (no
> decimals). How do I do that?|||The Format string "#" forces an integer numeral (100000), and "#,#" forces
an integer with commas in the right places (100,000).
There are also other possible format strings, like "D0" for "Decimal with 0
places after the point"
"DONNA" <DONNA@.discussions.microsoft.com> wrote in message
news:CC8FF726-6494-403A-9E9E-D4B76DED0804@.microsoft.com...
>I have a number 600.00 and would like to format it to look like 600 (no
> decimals). How do I do that?
decimals). How do I do that?Hi Donna,
If you want the number to round up use FormatNumber({your number},0)
If you want just what is left of the decimal use Floor({your number})
"DONNA" wrote:
> I have a number 600.00 and would like to format it to look like 600 (no
> decimals). How do I do that?|||The Format string "#" forces an integer numeral (100000), and "#,#" forces
an integer with commas in the right places (100,000).
There are also other possible format strings, like "D0" for "Decimal with 0
places after the point"
"DONNA" <DONNA@.discussions.microsoft.com> wrote in message
news:CC8FF726-6494-403A-9E9E-D4B76DED0804@.microsoft.com...
>I have a number 600.00 and would like to format it to look like 600 (no
> decimals). How do I do that?
formating decimals
Hi, I got money types coming out of the db.
I use #,##0.## all is swell 14.1400 comes out as 14.14,
14.0000 comes out as 14
but then I get 0 or 0.00, it comes out 0.00
I want it to be just 0
ThanksI would compare the value with what you consider a small enough value to be
taken as zero and use the appropriate formatting
iif(abs(dbvalue) < 0.0001, "0", "#,##0.##")
Andrei.
"yurps" <yurps@.yahoo.co.uk> wrote in message
news:1115831567.239111.316890@.o13g2000cwo.googlegroups.com...
> Hi, I got money types coming out of the db.
> I use #,##0.## all is swell 14.1400 comes out as 14.14,
> 14.0000 comes out as 14
> but then I get 0 or 0.00, it comes out 0.00
> I want it to be just 0
> Thanks
>
I use #,##0.## all is swell 14.1400 comes out as 14.14,
14.0000 comes out as 14
but then I get 0 or 0.00, it comes out 0.00
I want it to be just 0
ThanksI would compare the value with what you consider a small enough value to be
taken as zero and use the appropriate formatting
iif(abs(dbvalue) < 0.0001, "0", "#,##0.##")
Andrei.
"yurps" <yurps@.yahoo.co.uk> wrote in message
news:1115831567.239111.316890@.o13g2000cwo.googlegroups.com...
> Hi, I got money types coming out of the db.
> I use #,##0.## all is swell 14.1400 comes out as 14.14,
> 14.0000 comes out as 14
> but then I get 0 or 0.00, it comes out 0.00
> I want it to be just 0
> Thanks
>
Sunday, February 26, 2012
format number with decimals
I need to know to format a field that has decimals.
If the decimal portion is .00 then I do not want to display it.
For example:
1234.01 would display as 1234.01
1234.00 would display as 1234
Any help would be great thanks.
Dean
I found the answer:
if int({field})= {field} then
formula = totext({field},"##########")
else
formula = totext({field},"##########.##")
end ifHi,
Try this
if right(Cstr({feild}),3)=".00" then
mid(cstr({feild}),1,len(cstr({feild}))-3)
else
cstr({feild});
Madhivanan
If the decimal portion is .00 then I do not want to display it.
For example:
1234.01 would display as 1234.01
1234.00 would display as 1234
Any help would be great thanks.
Dean
I found the answer:
if int({field})= {field} then
formula = totext({field},"##########")
else
formula = totext({field},"##########.##")
end ifHi,
Try this
if right(Cstr({feild}),3)=".00" then
mid(cstr({feild}),1,len(cstr({feild}))-3)
else
cstr({feild});
Madhivanan
Format money MS SQL field data as number with commas and no decimals
If I pull a value from a MSSQL field with is defined as money, how can I get it to display in a textbox with commas and NO decimals?
87000.0000 = 87,000
I can currently remove the decimals like below but is there a way to add the commas as well?
decRevenue = drMyData("Revenue")
txtRevenue.Text = decRevenue.ToString("f0")
It current shows "87000".
http://msdn2.microsoft.com/en-us/library/dwhawy9k(VS.80).aspx
Friday, February 24, 2012
Format Currency Problem - HELP! ANYBODY
I need to display a number field with commas, $, and no decimals.
I tried FormatCurrency(fieldname,0,-1,-1 but the commas don't appear.
How can I accomplish what I need?
Thanks,
Gail BeedieIf your Regional Settings in Control Panel is US, then go to the Format
property of the field in the Properties sheet and type in C0. (letter "C"
followed by a zero).
If your Regional Settings is not US, then go to the Language property of the
textbox, select English (United States) from the listbox, then in the Format
property type in C0.
Alternatively, you can just use an expression: =Format(FieldName, "$#,###").
HTH
Charles Kangai, MCT, MCDBA
"Gail Beedie" wrote:
> I need to display a number field with commas, $, and no decimals.
> I tried FormatCurrency(fieldname,0,-1,-1 but the commas don't appear.
> How can I accomplish what I need?
> Thanks,
> Gail Beedie
>
I tried FormatCurrency(fieldname,0,-1,-1 but the commas don't appear.
How can I accomplish what I need?
Thanks,
Gail BeedieIf your Regional Settings in Control Panel is US, then go to the Format
property of the field in the Properties sheet and type in C0. (letter "C"
followed by a zero).
If your Regional Settings is not US, then go to the Language property of the
textbox, select English (United States) from the listbox, then in the Format
property type in C0.
Alternatively, you can just use an expression: =Format(FieldName, "$#,###").
HTH
Charles Kangai, MCT, MCDBA
"Gail Beedie" wrote:
> I need to display a number field with commas, $, and no decimals.
> I tried FormatCurrency(fieldname,0,-1,-1 but the commas don't appear.
> How can I accomplish what I need?
> Thanks,
> Gail Beedie
>
Sunday, February 19, 2012
Format a Percent, remove decimals.
I have the percent calculation for a pice chart in SRS, my chart has 4
values. it looks like:
=(Fields!Estimated_Value.Value)/Sum(Fields!Estimated_Value.Value)
My results look like
42.61%
25.63%
12.35%
19.41%
How do I format my result to remove the decimals and round the values
up?=Format((Fields!Estimated_Value.Value)/Sum(Fields!
Estimated_Value.Value),"###")|||Hi,
dineshasanka's answer was nearly right but it will round numbers up and down
i.e. 4.6% will round to 5% and 4.3% will round to 4%. To always round up
you need to add 0.5 to the calculated answer:-
=Format((Fields!Estimated_Value.Value)/Sum(Fields! Estimated_Value.Value) +
0.5,"###")
In the example above 4.6% + 0.5 becomes 5.1% and thus rounds down to 5%,
4.6% + 0.5 is 5.1% rounding down to 5%.
Hope it helps,
Dale
<dineshasanka@.gmail.com> wrote in message
news:ed19510b-9395-45a7-a055-4b62cba0e4df@.34g2000hsz.googlegroups.com...
> =Format((Fields!Estimated_Value.Value)/Sum(Fields!
> Estimated_Value.Value),"###")
>|||Thank you both, well my requirements changed a bit to needing to do
the same thing for a count, I opened another post for this issue but I
am not getting any feedback,
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/2be09ac8fcf5e49a/28cc4cc0db0e38a2#28cc4cc0db0e38a2
values. it looks like:
=(Fields!Estimated_Value.Value)/Sum(Fields!Estimated_Value.Value)
My results look like
42.61%
25.63%
12.35%
19.41%
How do I format my result to remove the decimals and round the values
up?=Format((Fields!Estimated_Value.Value)/Sum(Fields!
Estimated_Value.Value),"###")|||Hi,
dineshasanka's answer was nearly right but it will round numbers up and down
i.e. 4.6% will round to 5% and 4.3% will round to 4%. To always round up
you need to add 0.5 to the calculated answer:-
=Format((Fields!Estimated_Value.Value)/Sum(Fields! Estimated_Value.Value) +
0.5,"###")
In the example above 4.6% + 0.5 becomes 5.1% and thus rounds down to 5%,
4.6% + 0.5 is 5.1% rounding down to 5%.
Hope it helps,
Dale
<dineshasanka@.gmail.com> wrote in message
news:ed19510b-9395-45a7-a055-4b62cba0e4df@.34g2000hsz.googlegroups.com...
> =Format((Fields!Estimated_Value.Value)/Sum(Fields!
> Estimated_Value.Value),"###")
>|||Thank you both, well my requirements changed a bit to needing to do
the same thing for a count, I opened another post for this issue but I
am not getting any feedback,
http://groups.google.com/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/2be09ac8fcf5e49a/28cc4cc0db0e38a2#28cc4cc0db0e38a2
Subscribe to:
Posts (Atom)