Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Wednesday, March 28, 2012

Numeric Format Using Sql Server 2000 Query

I need to Format the number 123.745817 to 123.75 by using Sql Server 2000 Query

Quote:

Originally Posted by hisham123

I need to Format the number 123.745817 to 123.75 by using Sql Server 2000 Query


select convert(decimal(5,2),123.745817 ,0)|||

Quote:

Originally Posted by Vidhura

select convert(decimal(5,2),123.745817 ,0)


For those who don't understand the syntax, read below:

decimal[(p[, s])] and numeric[(p[, s])]

Fixed precision and scale numbers. When maximum precision is used, valid values are from - 10^38 +1 through 10^38 - 1. The SQL-92 synonyms for decimal are dec and dec(p, s).

p (precision)

Specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision. The maximum precision is 38. The default precision is 18.

s (scale)

Specifies the maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p. Scale can be specified only if precision is specified. The default scale is 0; therefore, 0 <= s <= p. Maximum storage sizes vary, based on the precision.

taken from here:

http://msdn2.microsoft.com/en-us/li...32(SQL.80).aspx

Numeric format - International settings

Hey,
I have following problem :
When is make a query in the enterprice manager I receive all numbers in an
european way (decimal = , no thousand separator is shown ex 1000,52).
When I make the same query in the query analyser i receive the output as
follows 1000.5200
I want it in an european format : 1000,52.
Is there a way to declare this in the query (like you can do with the
datatimes : set dateformat dmy).
I have the same problem when I export the data via a DTS. Can I not say to
him that he have to export numbers in a european format?
Thanks in advance
jacJac,
Try the Query Analyzer setting Tools|Options|Connections Tab|"Use
regional options when displaying currency, numbers, dates, and times."
The display in Query Analyzer will then conform to the Control Panel
settings for Regional display options.
Steve Kass
Drew University
jac wrote:

>Hey,
>I have following problem :
>When is make a query in the enterprice manager I receive all numbers in an
>european way (decimal = , no thousand separator is shown ex 1000,52).
>When I make the same query in the query analyser i receive the output as
>follows 1000.5200
>I want it in an european format : 1000,52.
>Is there a way to declare this in the query (like you can do with the
>datatimes : set dateformat dmy).
>I have the same problem when I export the data via a DTS. Can I not say to
>him that he have to export numbers in a european format?
>Thanks in advance
>jac
>|||Thanks Steve.
But how I say to my DTS (makes a query select * from XXX and export it in a
textfile) that he has to use the regional settings?
Thanks
"Steve Kass" wrote:

> Jac,
> Try the Query Analyzer setting Tools|Options|Connections Tab|"Use
> regional options when displaying currency, numbers, dates, and times."
> The display in Query Analyzer will then conform to the Control Panel
> settings for Regional display options.
> Steve Kass
> Drew University
> jac wrote:
>
>

Numeric format - International settings

Hey,
I have following problem :
When is make a query in the enterprice manager I receive all numbers in an
european way (decimal = , no thousand separator is shown ex 1000,52).
When I make the same query in the query analyser i receive the output as
follows 1000.5200
I want it in an european format : 1000,52.
Is there a way to declare this in the query (like you can do with the
datatimes : set dateformat dmy).
I have the same problem when I export the data via a DTS. Can I not say to
him that he have to export numbers in a european format?
Thanks in advance
jacJac,
Try the Query Analyzer setting Tools|Options|Connections Tab|"Use
regional options when displaying currency, numbers, dates, and times."
The display in Query Analyzer will then conform to the Control Panel
settings for Regional display options.
Steve Kass
Drew University
jac wrote:
>Hey,
>I have following problem :
>When is make a query in the enterprice manager I receive all numbers in an
>european way (decimal = , no thousand separator is shown ex 1000,52).
>When I make the same query in the query analyser i receive the output as
>follows 1000.5200
>I want it in an european format : 1000,52.
>Is there a way to declare this in the query (like you can do with the
>datatimes : set dateformat dmy).
>I have the same problem when I export the data via a DTS. Can I not say to
>him that he have to export numbers in a european format?
>Thanks in advance
>jac
>|||Thanks Steve.
But how I say to my DTS (makes a query select * from XXX and export it in a
textfile) that he has to use the regional settings?
Thanks
"Steve Kass" wrote:
> Jac,
> Try the Query Analyzer setting Tools|Options|Connections Tab|"Use
> regional options when displaying currency, numbers, dates, and times."
> The display in Query Analyzer will then conform to the Control Panel
> settings for Regional display options.
> Steve Kass
> Drew University
> jac wrote:
> >Hey,
> >
> >I have following problem :
> >When is make a query in the enterprice manager I receive all numbers in an
> >european way (decimal = , no thousand separator is shown ex 1000,52).
> >
> >When I make the same query in the query analyser i receive the output as
> >follows 1000.5200
> >I want it in an european format : 1000,52.
> >
> >Is there a way to declare this in the query (like you can do with the
> >datatimes : set dateformat dmy).
> >
> >I have the same problem when I export the data via a DTS. Can I not say to
> >him that he have to export numbers in a european format?
> >
> >Thanks in advance
> >jac
> >
> >
>

Numeric format - International settings

Hey,
I have following problem :
When is make a query in the enterprice manager I receive all numbers in an
european way (decimal = , no thousand separator is shown ex 1000,52).
When I make the same query in the query analyser i receive the output as
follows 1000.5200
I want it in an european format : 1000,52.
Is there a way to declare this in the query (like you can do with the
datatimes : set dateformat dmy).
I have the same problem when I export the data via a DTS. Can I not say to
him that he have to export numbers in a european format?
Thanks in advance
jac
Jac,
Try the Query Analyzer setting Tools|Options|Connections Tab|"Use
regional options when displaying currency, numbers, dates, and times."
The display in Query Analyzer will then conform to the Control Panel
settings for Regional display options.
Steve Kass
Drew University
jac wrote:

>Hey,
>I have following problem :
>When is make a query in the enterprice manager I receive all numbers in an
>european way (decimal = , no thousand separator is shown ex 1000,52).
>When I make the same query in the query analyser i receive the output as
>follows 1000.5200
>I want it in an european format : 1000,52.
>Is there a way to declare this in the query (like you can do with the
>datatimes : set dateformat dmy).
>I have the same problem when I export the data via a DTS. Can I not say to
>him that he have to export numbers in a european format?
>Thanks in advance
>jac
>
|||Thanks Steve.
But how I say to my DTS (makes a query select * from XXX and export it in a
textfile) that he has to use the regional settings?
Thanks
"Steve Kass" wrote:

> Jac,
> Try the Query Analyzer setting Tools|Options|Connections Tab|"Use
> regional options when displaying currency, numbers, dates, and times."
> The display in Query Analyzer will then conform to the Control Panel
> settings for Regional display options.
> Steve Kass
> Drew University
> jac wrote:
>
sql

Numbers problems in PDF

Dear All,

i am developing an application in arabic languge we had use the reporting service as our report engine we export the report to PDF format for printing or display

i have a problem with the numbers: when export to PDF the numbers not take the localization language i mean it always displayed in arabic number in need to be display in indean numbers

can u hlep me

hope my problem is clear.

Bolos

Hi,
you can check if your problem is resolved with SP2 :
http://support.microsoft.com/?kbid=889640

Monday, March 26, 2012

Number to Date

Hi,
I have a legacy system that uses a strange date format, wich I'd like to
convert for datetime on a new table.
The date is in this format: 104001(2004-01-01), 104002(2004-01-02),
104271(2004-09-27)
I think that I'll have to break the problem in two parts:
The year - three first digits + 1900
the day - three last digits (dy) day of the year.
I can generate the days by using "datepart(dy,date)", but how can i make the
way back? (to transform 271 in 09-27)
Thanks for your help.
SQL Server can do this with simple CAST operations, for instance, do:
SELECT CAST( CAST( 1900 + LEFT( c, 3 ) AS CHAR( 4 ) ) + '0101' AS DATETIME )
+ CAST( RIGHT( c, 3 ) AS INT ) - 1
FROM tbl ;
-- where c is the column from the table tbl.
Anith
|||Miguel,
Anith's solution will work for dates in or after the year 2000, but it
could give the wrong answer for earlier dates, if they are stored as
integers or as strings but without a leading zero. Here's an alternate
solution that should work:
select dateadd(year,@.c/1000,-1) + @.c%1000 from yourTable
Steve Kass
Drew University
Miguel Salles wrote:

>Hi,
>I have a legacy system that uses a strange date format, wich I'd like to
>convert for datetime on a new table.
>The date is in this format: 104001(2004-01-01), 104002(2004-01-02),
>104271(2004-09-27)
>I think that I'll have to break the problem in two parts:
>The year - three first digits + 1900
>the day - three last digits (dy) day of the year.
>I can generate the days by using "datepart(dy,date)", but how can i make the
>way back? (to transform 271 in 09-27)
>Thanks for your help.
>
>
sql

Monday, March 19, 2012

number formatting w/in charts and colors

1) How do you format numbers within charts. My numbers are currently without
commas (ex. 20000) and decimals with no formattting ( example: 679.8906890).
I would like them to be prettier with commas ( 20,000) and just 2 decimal
places ( 679.89) , respectively.
2) How do I assign colors to certain data values on my charts?
Please help...thank you.
Sincerely,
AllisonOn your first question: Pull up Chart properties dialog, go to Y-axis tab,
and type in c2 for Format Code.
On your second question: Pull up Chart properties dialog, go to Data tab ->
Edit button -> Point Labels tab -> Check Show Point Labels checkbox -> Click
on the Label Style button. You can then choose color, font, etc. for your
data labels. You can use an expression for Color as follows: =iif(
Fields!UnitPrice.Value <= 400.0, "Orange", "Green")
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ha Vo" <ha.vo@.prometheuslabs.com> wrote in message
news:OMhiwxLdEHA.2408@.tk2msftngp13.phx.gbl...
> 1) How do you format numbers within charts. My numbers are currently
without
> commas (ex. 20000) and decimals with no formattting ( example:
679.8906890).
> I would like them to be prettier with commas ( 20,000) and just 2 decimal
> places ( 679.89) , respectively.
> 2) How do I assign colors to certain data values on my charts?
> Please help...thank you.
> Sincerely,
> Allison
>

Number formatting in a SQL select statement

Hi

I'm trying to convert and format integer values in a SQL Server select statement to a string
representation of the number formated with ,'s (1000000 becomes 1,000,000 for example).

I've been looking at CAST and CONVERT and think the answers there somewhere. I just don't
seem to be able to work it out.

Anyone out there able to help me please?

Thanks,
Keith.

My suggestion would be to do this on the front end rather than the back end.
In any case, I think you will need to CAST your column as a money data type, and then CONVERT it using style 1, like this:
SELECT
CONVERT(varchar(20),CAST(myColumn AS money) ,1)
This will unfortuately also return the 2 digits after the decimal point. So my next step would be to strip them out.
This seems very messy, though. Hopefully someone else will have a better idea.

|||Yeah, that is messy.
<soapbox>
The first question I have is why isn't this being done in yourpresentation layer? SQL's strong suit is selecting data, not formattingit. Your ASP.NET environment already has tools that make this mucheasier than anything that we can come up with in SQL.
</soapbox>
Even messier would be this code sample, which is a function and/orstored procedure that accomplish what you are looking for. I've neverused it, but it looks right to me.
Jason
Update: Forgot to link - http://www.issociate.de/board/post/176502/How_do_I_format_an_integer.html
|||

Definitely a front-end issue. I've had to use SQL to format results when using SQLMail and it's a nightmare. Possible using combinations of cast, convert, charindex, substring, etc., but a nightmare. Use the front-end.

|||

Try this url it is using Strings and Formatting in the Framework Class library to do custom formatting. Hope this helps.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstringsoutputexample.asp

Kind regards,

Gift Peddie

Number formatting has me stumped

Hi, I dont seem to be able to output a number that has 3 decimal places.
The data source returns eg. 12.564 % and the output format on the report
is ##.###.
The output value though shows 12.56%, I want to show the figure above.
What am I missing or doing wrong? Is there a rounding switch or option I am
missing ?
Thanks in advance .Try this:
#,##0.000
returns:
50.123
0.000
15,050.123
15.050,123 (for example in german systems)
"PaulQld" <PaulQld@.discussions.microsoft.com> schrieb im Newsbeitrag
news:7C955125-6CD3-49DF-9028-D0AD04D2457E@.microsoft.com...
> Hi, I dont seem to be able to output a number that has 3 decimal places.
> The data source returns eg. 12.564 % and the output format on the report
> is ##.###.
> The output value though shows 12.56%, I want to show the figure above.
> What am I missing or doing wrong? Is there a rounding switch or option I
> am
> missing ?
> Thanks in advance .|||BTW, more information on number format strings can be found on MSDN:
*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp
*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jens Konerow" <keineangabe@.web.de> wrote in message
news:Ow%23cGYqwFHA.2132@.TK2MSFTNGP15.phx.gbl...
> Try this:
> #,##0.000
> returns:
> 50.123
> 0.000
> 15,050.123
> 15.050,123 (for example in german systems)
> "PaulQld" <PaulQld@.discussions.microsoft.com> schrieb im Newsbeitrag
> news:7C955125-6CD3-49DF-9028-D0AD04D2457E@.microsoft.com...
>> Hi, I dont seem to be able to output a number that has 3 decimal places.
>> The data source returns eg. 12.564 % and the output format on the report
>> is ##.###.
>> The output value though shows 12.56%, I want to show the figure above.
>> What am I missing or doing wrong? Is there a rounding switch or option I
>> am
>> missing ?
>> Thanks in advance .
>|||In the Textbox Properties under Format, select Custom.
Use "N3" for numbers, or "P3" for percentages. You will see the example
change to the format you are trying to get.
"PaulQld" wrote:
> Hi, I dont seem to be able to output a number that has 3 decimal places.
> The data source returns eg. 12.564 % and the output format on the report
> is ##.###.
> The output value though shows 12.56%, I want to show the figure above.
> What am I missing or doing wrong? Is there a rounding switch or option I am
> missing ?
> Thanks in advance .

NUMBER FORMATTING : round it to nearest whole number

HI,
CAN ANY ONE HELP me for this query.
i want to format the text field which takes numbers.I want to display the number as with no decimal places, round it to nearest whole number. For example,3.1 to 3.4 will round to 3 and 3.5 to 3.9 will round to 4.Have you tried using the Math.Round function?
Ex: Math.Round(YourVar, 0)
I think that'd do it, but it's been awhile since I've played with that function.
- T
"SRIRAM" wrote:
> HI,
> CAN ANY ONE HELP me for this query.
> i want to format the text field which takes numbers.I want to display the number as with no decimal places, round it to nearest whole number. For example,3.1 to 3.4 will round to 3 and 3.5 to 3.9 will round to 4.

Number Formats - Why does excel show 12.% instad of 12.0%?

I have a percentage cell within a matrix. I want this cell to be formatted to 1 decimal place, so I use the format of ##0.#% (After trying P1 etc). The cell appears formatted ok within the report viewer:

100%

12.9%

However after exporting to Excel the following occurs:

100.% - There is no 0 after the decimal point (but there is a decimal point . )

12.9% - Works ok when the the trailing digit is not a 0

Any ideas?

format: ##0.0%

number formats

Hi

I'm using Crystal Reports for Visual Studio 2005. I'm having problems with displaying numbers in the correct format.

I've gone into Design > Default Settings menu and set the format of number fields to no decimal place (i.e. 1 instead of 1.0) and taken out the thousand separator. But this doesn't seem to have made a difference.

On one report, the numbers show ok (e.g. 54) on the report preview but when I run it through my application, the numbers are showing with decimal places (e.g. 54.00).

On another report, the ids of the records shown in the report appear in the group tree and have thousand separators on them when run through my application. As with the other report, they appear correctly in the report preview!

How can I make the format show correctly when running the report through my application?

ThanksFor anyone that's interested, I got the answer elsewhere. the formula to use is ToText({fieldname},0,"")

Monday, March 12, 2012

number formating

I have this number 1556.2310 and I want to format it to this $1,556.2310.
Any suggestions? Thanks!Use Format Code C.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jessica C" <jesscobbe@.hotmail.com> wrote in message
news:%23F4jZsuXEHA.1036@.TK2MSFTNGP10.phx.gbl...
> I have this number 1556.2310 and I want to format it to this $1,556.2310.
> Any suggestions? Thanks!
>|||Actually that doesn't work because I want to keep four decimal places and
that rounds it down to two.... what I found is I could set the custom
format to "$#,##0.0000"
Thanks for your help
"Ravi Mumulla (Microsoft)" <ravimu@.online.microsoft.com> wrote in message
news:eh6qRzuXEHA.3044@.TK2MSFTNGP09.phx.gbl...
> Use Format Code C.
> --
> Ravi Mumulla (Microsoft)
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Jessica C" <jesscobbe@.hotmail.com> wrote in message
> news:%23F4jZsuXEHA.1036@.TK2MSFTNGP10.phx.gbl...
> > I have this number 1556.2310 and I want to format it to this
$1,556.2310.
> > Any suggestions? Thanks!
> >
> >
>|||Yes, that works.
--
Ravi Mumulla (Microsoft)
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Jessica C" <jesscobbe@.hotmail.com> wrote in message
news:%23x8cU4uXEHA.2448@.TK2MSFTNGP09.phx.gbl...
> Actually that doesn't work because I want to keep four decimal places and
> that rounds it down to two.... what I found is I could set the custom
> format to "$#,##0.0000"
> Thanks for your help
>
> "Ravi Mumulla (Microsoft)" <ravimu@.online.microsoft.com> wrote in message
> news:eh6qRzuXEHA.3044@.TK2MSFTNGP09.phx.gbl...
> > Use Format Code C.
> >
> > --
> > Ravi Mumulla (Microsoft)
> > SQL Server Reporting Services
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > "Jessica C" <jesscobbe@.hotmail.com> wrote in message
> > news:%23F4jZsuXEHA.1036@.TK2MSFTNGP10.phx.gbl...
> > > I have this number 1556.2310 and I want to format it to this
> $1,556.2310.
> > > Any suggestions? Thanks!
> > >
> > >
> >
> >
>|||Format code C allows the use of a decimal place precision specified: C[0-99]
--
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ravi Mumulla (Microsoft)" <ravimu@.online.microsoft.com> wrote in message
news:urepF6uXEHA.2408@.tk2msftngp13.phx.gbl...
> Yes, that works.
> --
> Ravi Mumulla (Microsoft)
> SQL Server Reporting Services
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Jessica C" <jesscobbe@.hotmail.com> wrote in message
> news:%23x8cU4uXEHA.2448@.TK2MSFTNGP09.phx.gbl...
> > Actually that doesn't work because I want to keep four decimal places
and
> > that rounds it down to two.... what I found is I could set the custom
> > format to "$#,##0.0000"
> >
> > Thanks for your help
> >
> >
> > "Ravi Mumulla (Microsoft)" <ravimu@.online.microsoft.com> wrote in
message
> > news:eh6qRzuXEHA.3044@.TK2MSFTNGP09.phx.gbl...
> > > Use Format Code C.
> > >
> > > --
> > > Ravi Mumulla (Microsoft)
> > > SQL Server Reporting Services
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > "Jessica C" <jesscobbe@.hotmail.com> wrote in message
> > > news:%23F4jZsuXEHA.1036@.TK2MSFTNGP10.phx.gbl...
> > > > I have this number 1556.2310 and I want to format it to this
> > $1,556.2310.
> > > > Any suggestions? Thanks!
> > > >
> > > >
> > >
> > >
> >
> >
>

Number format with negatives

I am trying to change the negatives to (1) instead of -1. I am using N0 as my format but I dont want to use currency because I dont want the dollar sign. How can I change this? Is there anyway to use currency without the $ sign?
MattTry the following format code on the textbox:
##.00;(##.00)

More details about format codes for numeric values can be found on MSDN:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
* http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericformatstringsoutputexample.asp
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp

BTW: the currency sign will always depend on the setting of the Language property (either of the report or individual textboxes). Set the language to a specific culture and you should get currency signs accordingly.

-- Robert

Number format with negatives

I am trying to change the negatives to (1) instead of -1. I am using N0 as my format but I dont want to use currency because I dont want the dollar sign. How can I change this? Is there anyway to use currency without the $ sign?
MattTry the following format code on the textbox:
##.00;(##.00)

More details about format codes for numeric values can be found on MSDN:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp
* http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcustomnumericformatstringsoutputexample.asp
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconstandardnumericformatstrings.asp

BTW: the currency sign will always depend on the setting of the Language property (either of the report or individual textboxes). Set the language to a specific culture and you should get currency signs accordingly.

-- Robert

Number format to return 0 when empty?

My client has several issues with the number formating in the reports.
They want to have a space between 1 000 and no decimals. First I created a
custom format, but today I noticed I could get the same result with N0.
Anyway, N0 format will not show empty numbers, it just leaves the cell
blank. But my client now wants to have a 0 instead of blank. Is it possible?
Kaisa M. LindahlTry using =IIF(<Your number field> Is Nothing, 0, <Your number field>) as
the value expression.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
news:e$Sm76V%23EHA.2076@.TK2MSFTNGP15.phx.gbl...
> My client has several issues with the number formating in the reports.
> They want to have a space between 1 000 and no decimals. First I created a
> custom format, but today I noticed I could get the same result with N0.
> Anyway, N0 format will not show empty numbers, it just leaves the cell
> blank. But my client now wants to have a 0 instead of blank. Is it
> possible?
> Kaisa M. Lindahl
>|||Yes, I've figured that one out.
Problem is, I'd have to do it on aprox. 20 cells in each report (> 10 so
far), all with different field names... If there are any other solutions,
I'd be very happy to hear it.
Kaisa M. Lindahl
"Fang Wang (MSFT)" <fangw@.microsoft.com> wrote in message
news:u907lUd#EHA.936@.TK2MSFTNGP12.phx.gbl...
> Try using =IIF(<Your number field> Is Nothing, 0, <Your number field>) as
> the value expression.
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> news:e$Sm76V%23EHA.2076@.TK2MSFTNGP15.phx.gbl...
> > My client has several issues with the number formating in the reports.
> > They want to have a space between 1 000 and no decimals. First I created
a
> > custom format, but today I noticed I could get the same result with N0.
> > Anyway, N0 format will not show empty numbers, it just leaves the cell
> > blank. But my client now wants to have a 0 instead of blank. Is it
> > possible?
> >
> > Kaisa M. Lindahl
> >
> >
>|||I'm sorry, but there is no "easier" solution than using IIF for this
scenario.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
news:ORxJ1Jh%23EHA.3988@.TK2MSFTNGP11.phx.gbl...
> Yes, I've figured that one out.
> Problem is, I'd have to do it on aprox. 20 cells in each report (> 10 so
> far), all with different field names... If there are any other solutions,
> I'd be very happy to hear it.
> Kaisa M. Lindahl
> "Fang Wang (MSFT)" <fangw@.microsoft.com> wrote in message
> news:u907lUd#EHA.936@.TK2MSFTNGP12.phx.gbl...
> > Try using =IIF(<Your number field> Is Nothing, 0, <Your number field>)
as
> > the value expression.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> > "Kaisa M. Lindahl" <kaisaml@.hotmail.com> wrote in message
> > news:e$Sm76V%23EHA.2076@.TK2MSFTNGP15.phx.gbl...
> > > My client has several issues with the number formating in the reports.
> > > They want to have a space between 1 000 and no decimals. First I
created
> a
> > > custom format, but today I noticed I could get the same result with
N0.
> > > Anyway, N0 format will not show empty numbers, it just leaves the cell
> > > blank. But my client now wants to have a 0 instead of blank. Is it
> > > possible?
> > >
> > > Kaisa M. Lindahl
> > >
> > >
> >
> >
>

number format to 2 decimals

How can I format my data to 2 decimal numbers in sql ?
select numericColumn from table1
ex :-
numericColumn
10.22
20.00
30.45
12.02
regards
ypul
ypul wrote:
> How can I format my data to 2 decimal numbers in sql ?
> select numericColumn from table1
> ex :-
> numericColumn
> --
> 10.22
> 20.00
> 30.45
> 12.02
> regards
> ypul
What data type are you using in the table?
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||numericcolumn datatype is float
ypul
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:%23cf2O3PnFHA.2472@.TK2MSFTNGP15.phx.gbl...
> ypul wrote:
> What data type are you using in the table?
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
|||ypul wrote:
> numericcolumn datatype is float
> ypul
>
Probably using the wrong data type. Why have you chosen to use an
approximate data type like float/real instead of DECIMAL/NUMERIC which
stores an exact represenation of a number? Do you really need to store.
From BOL:
"Approximate number data types for use with floating point numeric data.
Floating point data is approximate; not all values in the data type
range can be precisely represented."
If you either must use a float or cannot change the data type to
something more appropriate, you have two options:
1- Format the numeric data on the client - client formatting is
preferred over using SQL Server to do the same
2- Use the CAST function, but you may have to deal with rounding issues
For example:
Declare @.f real
Set @.f = .05
Select @.f -- Returns 5.5500001E-2
Select CAST(@.f as NUMERIC(10, 2)) -- Returns .06
David Gugick
Quest Software
www.imceda.com
www.quest.com
|||Thanks Buddy
that was very very .....helpful !!
ypul
"David Gugick" <david.gugick-nospam@.quest.com> wrote in message
news:e8NGR%23SnFHA.2860@.TK2MSFTNGP15.phx.gbl...
> ypul wrote:
> Probably using the wrong data type. Why have you chosen to use an
> approximate data type like float/real instead of DECIMAL/NUMERIC which
> stores an exact represenation of a number? Do you really need to store.
> From BOL:
> "Approximate number data types for use with floating point numeric data.
> Floating point data is approximate; not all values in the data type
> range can be precisely represented."
> If you either must use a float or cannot change the data type to
> something more appropriate, you have two options:
> 1- Format the numeric data on the client - client formatting is
> preferred over using SQL Server to do the same
> 2- Use the CAST function, but you may have to deal with rounding issues
> For example:
> Declare @.f real
> Set @.f = .05
> Select @.f -- Returns 5.5500001E-2
> Select CAST(@.f as NUMERIC(10, 2)) -- Returns .06
>
> --
> David Gugick
> Quest Software
> www.imceda.com
> www.quest.com
>

Number format do not work when exported to excel?

I have a report where I have formated the numbers with #.#. When I run this
repot this works well and give me the decimal only when it is needed.
However, when I export to excel, I get te decimal point even when it is not
needed. For example the when I have the whole number 100 it displays as 100.
in excel.
I could use the N1, but I do not want 100.0 to display either.
Any help would be appreciated.
p.s. I am using a matrix if that makes a difference. I have not noticed
this when exporting a table, although I don't know it doesn't happen.On Mar 22, 8:58 am, bugfish69 <bugfis...@.discussions.microsoft.com>
wrote:
> I have a report where I have formated the numbers with #.#. When I run this
> repot this works well and give me the decimal only when it is needed.
> However, when I export to excel, I get te decimal point even when it is not
> needed. For example the when I have the whole number 100 it displays as 100.
> in excel.
> I could use the N1, but I do not want 100.0 to display either.
> Any help would be appreciated.
> p.s. I am using a matrix if that makes a difference. I have not noticed
> this when exporting a table, although I don't know it doesn't happen.
It sounds like this is a defect in the export to Excel functionality.
Sorry I could not be of more assistance.
Regards,
Enrique Martinez
Sr. SQL Server Developer|||How about using a conditional formating expression to supress the trailing
zero:
=iif(Fields!.<FieldName>.Value - Fix(Fields!.<FieldName>.Value = 0, "#",
"#.0")
"EMartinez" wrote:
> On Mar 22, 8:58 am, bugfish69 <bugfis...@.discussions.microsoft.com>
> wrote:
> > I have a report where I have formated the numbers with #.#. When I run this
> > repot this works well and give me the decimal only when it is needed.
> > However, when I export to excel, I get te decimal point even when it is not
> > needed. For example the when I have the whole number 100 it displays as 100.
> > in excel.
> >
> > I could use the N1, but I do not want 100.0 to display either.
> >
> > Any help would be appreciated.
> >
> > p.s. I am using a matrix if that makes a difference. I have not noticed
> > this when exporting a table, although I don't know it doesn't happen.
> It sounds like this is a defect in the export to Excel functionality.
> Sorry I could not be of more assistance.
> Regards,
> Enrique Martinez
> Sr. SQL Server Developer
>|||Thanks for the tip. It solved the problem in this instance, however it does
get messy when the filed is a calculated field and not just a field name.
"Bruce Johnson [MSFT]" wrote:
> How about using a conditional formating expression to supress the trailing
> zero:
> =iif(Fields!.<FieldName>.Value - Fix(Fields!.<FieldName>.Value = 0, "#",
> "#.0")
>
> "EMartinez" wrote:
> > On Mar 22, 8:58 am, bugfish69 <bugfis...@.discussions.microsoft.com>
> > wrote:
> > > I have a report where I have formated the numbers with #.#. When I run this
> > > repot this works well and give me the decimal only when it is needed.
> > > However, when I export to excel, I get te decimal point even when it is not
> > > needed. For example the when I have the whole number 100 it displays as 100.
> > > in excel.
> > >
> > > I could use the N1, but I do not want 100.0 to display either.
> > >
> > > Any help would be appreciated.
> > >
> > > p.s. I am using a matrix if that makes a difference. I have not noticed
> > > this when exporting a table, although I don't know it doesn't happen.
> >
> > It sounds like this is a defect in the export to Excel functionality.
> > Sorry I could not be of more assistance.
> >
> > Regards,
> >
> > Enrique Martinez
> > Sr. SQL Server Developer
> >
> >

Number Format based on Regional settings

Sir,

Plz...Help me.. The same question i posted around 2 months back. I am need the answer very badly...If anybody can help me...i w'll b very thankful

I am Using Crystal report 10.
How to Display The Number Format as like The Regional Setting in The computer.

After Changing The Regional Settings, I Changed The Number Format to The System Default Format...But It is Not Working...

Plz Help meRight Click on the number filed select Format number;goto Number tab and select the format you want|||Hi,

I know that.Here the situation is that In rgional setting we are having option called Number digit grouping and currency digit Grouping..

The default format of Both is 123,456,789. I changed The above things to

12,34,56,789. But the same is not reflecting in crystal report in case of currency or digit.
I want the above format in my report..

OR

I can make clear That I dont want the Thousand seperator..Instead of That it should take The format,which is in the regional settings!!

Can u help me

Thanks

Ambily

Number Format after Exporting to Excel from Reporting Services

I suddenly have a large amount of users asking me why they can't do
sums on Excel 2003 exported Reporting Services reports. The numbers
in the cells are not formatted as numbers nor does it appear like you
can change it within Excel. Some are retypeing number into each
column.
Is this something I can control within Reporting Services or does
something need to be done within Excel after the export.
Any help would be great.
Thanks,
MikeOn Jul 13, 12:52 pm, michael h <mikej...@.gmail.com> wrote:
> I suddenly have a large amount of users asking me why they can't do
> sums on Excel 2003 exported Reporting Services reports. The numbers
> in the cells are not formatted as numbers nor does it appear like you
> can change it within Excel. Some are retypeing number into each
> column.
> Is this something I can control within Reporting Services or does
> something need to be done within Excel after the export.
> Any help would be great.
> Thanks,
> Mike
You might be able to convert the numbers via an expression and that
way it can export and be recognized as an integer/long value. An
expression similar to this might work.
=CInt(Fields!FieldName.Value)
-or-
=CLng(Fields!FieldName.Value)
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant