Showing posts with label numbers. Show all posts
Showing posts with label numbers. Show all posts

Wednesday, March 28, 2012

Numeric Formatting

How can I achieve the following:
I'd like negative numbers to be enclosed in brackets and the decimals to
lign up (vertically) with the positive numbers (right justified).
I have used, Format ="#,##0.00 ;(#,##0.00); ", but the space is trimmed. Any
ideas ?
Thanks,
ClaudeI am not in front of Visual Studio so I cannot test this...
My idea is that you could use an expression to alter the right padding of
the numbers. If they are <0 then 2pt else 4pt (or whatever the width of the
bracket).
This is a little hackish because if you ever change the font, size or
anything that padding would change.
"Claude" <Claude@.discussions.microsoft.com> wrote in message
news:AC41BE0F-895D-4C2C-A1CA-0309F18A29EC@.microsoft.com...
> How can I achieve the following:
> I'd like negative numbers to be enclosed in brackets and the decimals to
> lign up (vertically) with the positive numbers (right justified).
> I have used, Format ="#,##0.00 ;(#,##0.00); ", but the space is trimmed.
> Any
> ideas ?
> Thanks,
> Claude|||You are spot on Joe. Thanks for the help.
Claude
"Joe L" wrote:
> I am not in front of Visual Studio so I cannot test this...
> My idea is that you could use an expression to alter the right padding of
> the numbers. If they are <0 then 2pt else 4pt (or whatever the width of the
> bracket).
> This is a little hackish because if you ever change the font, size or
> anything that padding would change.
>
> "Claude" <Claude@.discussions.microsoft.com> wrote in message
> news:AC41BE0F-895D-4C2C-A1CA-0309F18A29EC@.microsoft.com...
> > How can I achieve the following:
> >
> > I'd like negative numbers to be enclosed in brackets and the decimals to
> > lign up (vertically) with the positive numbers (right justified).
> >
> > I have used, Format ="#,##0.00 ;(#,##0.00); ", but the space is trimmed.
> > Any
> > ideas ?
> >
> > Thanks,
> > Claude
>
>

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

numeric data types

Hi,

I have a lot of decimals in the flat files. So far the largest numbers map to a numeric(18,6).

My question is, is DT_NUMERIC the correct datatype for this data? In which case, what size do I need to set it? Right now it's 18. Couldn't find much info on this.

Thanks

DT_NUMERIC is correct. For the example you've given, set precision to 18 and scale to 6.|||SSIS data types: http://msdn2.microsoft.com/en-us/library/ms141036.aspx|||Is there a trick to doing this? I tried 18,6 and it said it was invalid.|||

More precisely, the error is:

18,6 is not a valid value for Int32.

I have DT_NUMERIC selected as data type.

|||

Have you set 18 in the precision box and 6 in the scale box or "18,6" in a single box? 18 and 6 are separate attributes.

Thanks.

sql

Numbers show as exponential

Hello,
I am using the code below to sum values for the web. Instead of getting
11911712.0, I am getting 1.19117e+007. Is there a way to prevent numbers
from being show in exponential?
IsNull(Convert(varchar(30),(SUM(CASE WHEN Treg.Region = 'AP' Then T.Value
ELSE NULL END))), '&nbsp;') AS strValue
Thanks in advance,
Steven
I'm guessing that T.Value is a floating point datatype?
If so, then the problem is deeper then a display issue. Floating point datatypes only store so many signifigant digits of precision - the other digits are lost. They are turned into 0's.
|||One thing you might try is to convert the number to a decimal before
converting it to a varchar...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Steven K" <skaper@.troop.com> wrote in message
news:OIk2gv2PEHA.3660@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I am using the code below to sum values for the web. Instead of getting
> 11911712.0, I am getting 1.19117e+007. Is there a way to prevent numbers
> from being show in exponential?
>
> IsNull(Convert(varchar(30),(SUM(CASE WHEN Treg.Region = 'AP' Then T.Value
> ELSE NULL END))), '&nbsp;') AS strValue
> --
> Thanks in advance,
> Steven
>
sql

Numbers show as exponential

Hello,
I am using the code below to sum values for the web. Instead of getting
11911712.0, I am getting 1.19117e+007. Is there a way to prevent numbers
from being show in exponential?
IsNull(Convert(varchar(30),(SUM(CASE WHEN Treg.Region = 'AP' Then T.Value
ELSE NULL END))), ' ') AS strValue
--
Thanks in advance,
StevenI'm guessing that T.Value is a floating point datatype?
If so, then the problem is deeper then a display issue. Floating point datatypes only store so many signifigant digits of precision - the other digits are lost. They are turned into 0's.|||One thing you might try is to convert the number to a decimal before
converting it to a varchar...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Steven K" <skaper@.troop.com> wrote in message
news:OIk2gv2PEHA.3660@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I am using the code below to sum values for the web. Instead of getting
> 11911712.0, I am getting 1.19117e+007. Is there a way to prevent numbers
> from being show in exponential?
>
> IsNull(Convert(varchar(30),(SUM(CASE WHEN Treg.Region = 'AP' Then T.Value
> ELSE NULL END))), ' ') AS strValue
> --
> Thanks in advance,
> Steven
>

Numbers show as exponential

Hello,
I am using the code below to sum values for the web. Instead of getting
11911712.0, I am getting 1.19117e+007. Is there a way to prevent numbers
from being show in exponential?
IsNull(Convert(varchar(30),(SUM(CASE WHEN Treg.Region = 'AP' Then T.Value
ELSE NULL END))), ' ') AS strValue
Thanks in advance,
StevenI'm guessing that T.Value is a floating point datatype'
If so, then the problem is deeper then a display issue. Floating point data
types only store so many signifigant digits of precision - the other digits
are lost. They are turned into 0's.|||One thing you might try is to convert the number to a decimal before
converting it to a varchar...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Steven K" <skaper@.troop.com> wrote in message
news:OIk2gv2PEHA.3660@.TK2MSFTNGP11.phx.gbl...
> Hello,
> I am using the code below to sum values for the web. Instead of getting
> 11911712.0, I am getting 1.19117e+007. Is there a way to prevent numbers
> from being show in exponential?
>
> IsNull(Convert(varchar(30),(SUM(CASE WHEN Treg.Region = 'AP' Then T.Value
> ELSE NULL END))), ' ') AS strValue
> --
> Thanks in advance,
> Steven
>

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

Numbers of rows returned from mquery

I am using the following code to find if a use exits in the table:
declare @.UserName char(30)
set @.UserName = (select fullname from udf_GetUserName(@.UserId))
SELECT @.@.ROWCOUNT
but that always returns 1. How do I solve that?
ThanksYou are getting the rowcount value for the SET variable statement, which
obviously always equal to 1. If you'd like to know how many full name values
exist for a given identifier, you might consider using COUNT(*) like:
SELECT COUNT(*) FROM tbl_valued_udf ;
or avoid the assignment and do:
SELECT col FROM tbl_valued_udf ;
SELECT @.@.ROWCOUNT ;
Alternatively to check the existence, you could do:
IF EXISTS ( SELECT * FROM tbl_valued_udf )
Anith|||You solve it by asking the correct query. :)
What you are asking SQL to return is the number of rows affected by the
previous statement. Since the previous SELECT always returns a single row,
you get a rowcount of 1. What you really should do is select the fullname
from the underlying user table (or from an abstraction such as a view or
procedure) where the userID = @.userID (supplied parameter). If you get an
empty result set, then the user doesn't exist.
It looks like someone is trying to write an abstraction layer for
programmers so they won't have to learn any SQL. That leads to some really
bad code.
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Markgoldin" <Markgoldin@.discussions.microsoft.com> wrote in message
news:A494674C-147F-4009-8C40-99C163F6568D@.microsoft.com...
>I am using the following code to find if a use exits in the table:
> declare @.UserName char(30)
> set @.UserName = (select fullname from udf_GetUserName(@.UserId))
> SELECT @.@.ROWCOUNT
> but that always returns 1. How do I solve that?
> Thanks|||Why not just test IF IS NULL(@.UserName) instead?
Roy Harvey
Beacon Falls, CT
On Wed, 5 Apr 2006 12:47:01 -0700, Markgoldin
<Markgoldin@.discussions.microsoft.com> wrote:

>I am using the following code to find if a use exits in the table:
>declare @.UserName char(30)
>set @.UserName = (select fullname from udf_GetUserName(@.UserId))
>SELECT @.@.ROWCOUNT
>but that always returns 1. How do I solve that?
>Thanks

Numbers of DB in SQL

Is there a limitation of how many db you can have in SQL Standard Edition?
Will it cause problem if we have too much? somewhere around 45 DBs.
Thanks.
The documented limit is 32767 databases per server instance, so you have
some way to go yet! With the appropriate hardware 45 databases is certainly
no problem.
David Portas
SQL Server MVP
|||Thanks for replied my post. My server is a Dell 8450 Quad-processors with 2
GB of RAM.
"David Portas" wrote:

> The documented limit is 32767 databases per server instance, so you have
> some way to go yet! With the appropriate hardware 45 databases is certainly
> no problem.
> --
> David Portas
> SQL Server MVP
> --
>
>
|||David,
I think that when David Portas mentioned "appropriate hardware", he didn't
mean that there's some magic formula for 45 databases. It depends on what
those databases are doing -- how much data they contain, how many users
concurrently use each of them, what those users are doing, etc. If each
database has 100 concurrent users doing million-row queries, you'll quickly
run into a problem. On the other hand, if each database has 1 table with 10
rows of data and has a query run against it once a week, you'll be able to
support thousands of databases
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"David" <David@.discussions.microsoft.com> wrote in message
news:668C567C-E459-4ABB-A1F7-129BBADD6EB8@.microsoft.com...
> Thanks for replied my post. My server is a Dell 8450 Quad-processors with
2[vbcol=seagreen]
> GB of RAM.
> "David Portas" wrote:
certainly[vbcol=seagreen]
|||David,
In addition to David's and Adam's excellent responses, you may find
limitations with SQL-DMO which will manifest through Enterprise Manager.
After a certain number of databases, you will find that enumeration of
databases will take a long time when you expand the databases node in
the tree. At some point you will find that it takes longer than you are
willing to wait for it, and you will have to administer your databases
using T-SQL.
SMO in SQL Server 2005 addresses this issue by using partial
instantiation (aka delayed instantiation) and caching.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
David wrote:
> Is there a limitation of how many db you can have in SQL Standard Edition?
> Will it cause problem if we have too much? somewhere around 45 DBs.
> Thanks.
>
sql

Numbers of DB in SQL

Is there a limitation of how many db you can have in SQL Standard Edition?
Will it cause problem if we have too much? somewhere around 45 DBs.
Thanks.The documented limit is 32767 databases per server instance, so you have
some way to go yet! With the appropriate hardware 45 databases is certainly
no problem.
--
David Portas
SQL Server MVP
--|||Thanks for replied my post. My server is a Dell 8450 Quad-processors with 2
GB of RAM.
"David Portas" wrote:
> The documented limit is 32767 databases per server instance, so you have
> some way to go yet! With the appropriate hardware 45 databases is certainly
> no problem.
> --
> David Portas
> SQL Server MVP
> --
>
>|||David,
I think that when David Portas mentioned "appropriate hardware", he didn't
mean that there's some magic formula for 45 databases. It depends on what
those databases are doing -- how much data they contain, how many users
concurrently use each of them, what those users are doing, etc. If each
database has 100 concurrent users doing million-row queries, you'll quickly
run into a problem. On the other hand, if each database has 1 table with 10
rows of data and has a query run against it once a week, you'll be able to
support thousands of databases :)
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"David" <David@.discussions.microsoft.com> wrote in message
news:668C567C-E459-4ABB-A1F7-129BBADD6EB8@.microsoft.com...
> Thanks for replied my post. My server is a Dell 8450 Quad-processors with
2
> GB of RAM.
> "David Portas" wrote:
> > The documented limit is 32767 databases per server instance, so you have
> > some way to go yet! With the appropriate hardware 45 databases is
certainly
> > no problem.
> >
> > --
> > David Portas
> > SQL Server MVP
> > --
> >
> >
> >|||David,
In addition to David's and Adam's excellent responses, you may find
limitations with SQL-DMO which will manifest through Enterprise Manager.
After a certain number of databases, you will find that enumeration of
databases will take a long time when you expand the databases node in
the tree. At some point you will find that it takes longer than you are
willing to wait for it, and you will have to administer your databases
using T-SQL.
SMO in SQL Server 2005 addresses this issue by using partial
instantiation (aka delayed instantiation) and caching.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
David wrote:
> Is there a limitation of how many db you can have in SQL Standard Edition?
> Will it cause problem if we have too much? somewhere around 45 DBs.
> Thanks.
>

Numbers of DB in SQL

Is there a limitation of how many db you can have in SQL Standard Edition?
Will it cause problem if we have too much? somewhere around 45 DBs.
Thanks.The documented limit is 32767 databases per server instance, so you have
some way to go yet! With the appropriate hardware 45 databases is certainly
no problem.
David Portas
SQL Server MVP
--|||Thanks for replied my post. My server is a Dell 8450 Quad-processors with 2
GB of RAM.
"David Portas" wrote:

> The documented limit is 32767 databases per server instance, so you have
> some way to go yet! With the appropriate hardware 45 databases is certainl
y
> no problem.
> --
> David Portas
> SQL Server MVP
> --
>
>|||David,
I think that when David Portas mentioned "appropriate hardware", he didn't
mean that there's some magic formula for 45 databases. It depends on what
those databases are doing -- how much data they contain, how many users
concurrently use each of them, what those users are doing, etc. If each
database has 100 concurrent users doing million-row queries, you'll quickly
run into a problem. On the other hand, if each database has 1 table with 10
rows of data and has a query run against it once a week, you'll be able to
support thousands of databases
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"David" <David@.discussions.microsoft.com> wrote in message
news:668C567C-E459-4ABB-A1F7-129BBADD6EB8@.microsoft.com...
> Thanks for replied my post. My server is a Dell 8450 Quad-processors with
2[vbcol=seagreen]
> GB of RAM.
> "David Portas" wrote:
>
certainly[vbcol=seagreen]|||David,
In addition to David's and Adam's excellent responses, you may find
limitations with SQL-DMO which will manifest through Enterprise Manager.
After a certain number of databases, you will find that enumeration of
databases will take a long time when you expand the databases node in
the tree. At some point you will find that it takes longer than you are
willing to wait for it, and you will have to administer your databases
using T-SQL.
SMO in SQL Server 2005 addresses this issue by using partial
instantiation (aka delayed instantiation) and caching.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
David wrote:
> Is there a limitation of how many db you can have in SQL Standard Edition?
> Will it cause problem if we have too much? somewhere around 45 DBs.
> Thanks.
>

Numbers less than zero

In a pretty standard select statement (as shown), i want to return 0 when "dbo.v_AgentOrderTotals.Total - dbo.v_AgentAmmountPaid.total - dbo.v_AgentCommClean.total AS amount_outstanding_commission" is less than 0.

SELECT dbo.t_Agents.agent_code, dbo.v_CurrentParamPaymentTotal.ammount AS weekley_payment_total,
dbo.v_AgentNumberOfCustomers.count AS number_of_cust, dbo.v_AgentAmmountPaid.total AS total_paid,
dbo.v_AgentOrderTotals.Total AS ytd_order_total, dbo.v_AgentOrderTotals.Total - dbo.v_AgentAmmountPaid.total AS amount_outstanding,
ISNULL(dbo.v_AgentAmmountPaid.total / dbo.v_AgentOrderTotals.Total, 0) * 100 AS ytd_percentage,
dbo.v_AgentOrderTotals.Total - dbo.v_AgentAmmountPaid.total - dbo.v_AgentCommClean.total AS amount_outstanding_commission,
ISNULL(dbo.v_AgentOrderChange.amount, 0) AS net_weekly_order
FROM dbo.t_Agents LEFT OUTER JOIN
dbo.v_AgentOrderChange ON dbo.t_Agents.AGENT_ID = dbo.v_AgentOrderChange.AGENT_ID LEFT OUTER JOIN
dbo.v_AgentCommClean ON dbo.t_Agents.AGENT_ID = dbo.v_AgentCommClean.AGENT_ID LEFT OUTER JOIN
dbo.v_AgentNumberOfCustomers ON dbo.t_Agents.AGENT_ID = dbo.v_AgentNumberOfCustomers.AGENT_ID LEFT OUTER JOIN
dbo.v_AgentOrderTotals ON dbo.t_Agents.AGENT_ID = dbo.v_AgentOrderTotals.AGENT_ID LEFT OUTER JOIN
dbo.v_AgentAmmountPaid ON dbo.t_Agents.AGENT_ID = dbo.v_AgentAmmountPaid.AGENT_ID LEFT OUTER JOIN
dbo.v_CurrentParamPaymentTotal ON dbo.t_Agents.AGENT_ID = dbo.v_CurrentParamPaymentTotal.AGENT_ID

Any ideas how i do this?

Cheers
Anthony Swift

CASE

WHEN (dbo.v_AgentOrderTotals.Total - dbo.v_AgentAmmountPaid.total - dbo.v_AgentCommClean.total) < THEN 0

ELSE dbo.v_AgentOrderTotals.Total - dbo.v_AgentAmmountPaid.total - dbo.v_AgentCommClean.total

END AS amount_outstanding_commission

|||Cheers :)

Numbers and Crystal Reports 9

I exported a column of type float to SQL Server using DTS. In Crystal
reports, it 'sees' the column as a string! Is 'float' the best type to
use? Must I create a formula field in CR to 'correct' for this?Hi

From the database side you should choose the most appropriate datatype for
the data which it will hold, at a guess decimal might be more appropriate.

Its been a while since I used Crystal so I can't remember how it determined
the datatypes, but I seem to remember that you mask the output to be in the
format that you require.

John

"chrispycrunch" <chrispycrunch@.gmail.com> wrote in message
news:1107712517.428328.79850@.o13g2000cwo.googlegro ups.com...
>I exported a column of type float to SQL Server using DTS. In Crystal
> reports, it 'sees' the column as a string! Is 'float' the best type to
> use? Must I create a formula field in CR to 'correct' for this?|||chrispycrunch (chrispycrunch@.gmail.com) writes:
> I exported a column of type float to SQL Server using DTS. In Crystal
> reports, it 'sees' the column as a string! Is 'float' the best type to
> use? Must I create a formula field in CR to 'correct' for this?

So if you sp_help on the table in Query Analyzer, it is reported to be
a float?

If so, you should probably ask in a forum devoted to Crystal Reports. We
use Crystal in our shop, but I don't have it installed on my machine...

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:4206972c$0$7707$fa0fcedb@.news.zen.co.uk...
> Hi
> From the database side you should choose the most appropriate datatype for
> the data which it will hold, at a guess decimal might be more appropriate.
> Its been a while since I used Crystal so I can't remember how it
> determined the datatypes, but I seem to remember that you mask the output
> to be in the format that you require.
> John
> "chrispycrunch" <chrispycrunch@.gmail.com> wrote in message
> news:1107712517.428328.79850@.o13g2000cwo.googlegro ups.com...
>>I exported a column of type float to SQL Server using DTS. In Crystal
>> reports, it 'sees' the column as a string! Is 'float' the best type to
>> use? Must I create a formula field in CR to 'correct' for this?
>
I would imagine decimal is probably more appropriate than float.

I usually base my crystal reports on stored procedures rather than directly
on tables.
I can then do any "work" necessary to make the crystal report easier to put
together in the stored procedure which I, quite frankly, find a lot easier
to work with than the crystal alternatives.
I'd do any maths I could in the stored procedure as well.
If float is best for storage and decimal for presentation then you could
cast the field in your stored procedure's select statement.

If these are no good for you then, is it just a presentation thing?
You can specify a formula for display format of a field in crystal.

HTH
--
Regards,
Andy O'Neill

Numbering in SQL

I have table with 10-20 rows with field P6 which is empty. I want to
update numbers to P6 starting 1 and increasing by 1. I suppose it is
done by triggers but I don't know how to do that. Help :-)is this as 1 off or every time you INSERT a record?

--
--
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
___________________________________

<lemes_m@.yahoo.com> wrote in message
news:1148037597.406952.273140@.j33g2000cwa.googlegr oups.com...
> I have table with 10-20 rows with field P6 which is empty. I want to
> update numbers to P6 starting 1 and increasing by 1. I suppose it is
> done by triggers but I don't know how to do that. Help :-)|||Make the column a identity value, this way it is incremented with every
insert:

int IDENTITY (1, 1)|||lemes_m@.yahoo.com (lemes_m@.yahoo.com) writes:
> I have table with 10-20 rows with field P6 which is empty. I want to
> update numbers to P6 starting 1 and increasing by 1. I suppose it is
> done by triggers but I don't know how to do that. Help :-)

Without further knowledge about the table it is difficult to give
advice. And if the rest of the data is not unique, it's getting sort
of ugly.

For a one-off you could do:

DECLARE @.i int
SELECT @.i = 1
-- SET ROWCOUNT 1 Use this on SQL 2000.
WHILE EXISTS (SELECT * FROM tbl WHERE P6 IS NULL)
BEGIN
UPDATE /* TOP(1) */ tbl -- Remove comment for SQL 2005.
SET P6 = @.i

SELECT @.i = @.i + 1
END
-- SET ROWCOUNT 0 again, for SQL 2000.

But I would not like to see this code in a trigger.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||>> have table with 10-20 rows with field [sic] P6 which is empty [sic]. <<

You have NEVER written SQL before, have you? Columsn are not fields
and we have NULLs, not the empty spreadsheet cells you assume. TOTALLY
WRONG MINDSET!

>> I want to update numbers to P6 starting 1 and increasing by 1. <<

That is a SEQUENTAL MAGNETIC TAPE FILE and you are tryignto write
1950's code in SQL! It has northing whatsoever to do with RDBMS.
Tables have no ordering by definition. This is soooooo wrong ...|||Geeesh!!! You can insert a set at a time, so adding one to a previous
value makes no sense. Doesn't anyone go to RDBMS classes any more?|||>> Make the column a identity value, this way it is incremented with every insert: <<

Always go for the proprietary and most non-relational kludge? LET'S
FINBD OUT WHAT HE IS REALLY TRYIGN TO DO BEFORE WE POST ANYTHING ELSE.

Okay, lemes_m@.yahoo.com , why do you want to destroy the relational
model? What is your business goal?|||Hi Lemes,

Check out http://blogs.msdn.com/sqlcat/archiv.../10/572848.aspx it has
good examples of how to do this.

Tony.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials

<lemes_m@.yahoo.com> wrote in message
news:1148037597.406952.273140@.j33g2000cwa.googlegr oups.com...
>I have table with 10-20 rows with field P6 which is empty. I want to
> update numbers to P6 starting 1 and increasing by 1. I suppose it is
> done by triggers but I don't know how to do that. Help :-)

Monday, March 19, 2012

number in words

Hy,

I use Reporting Services with Visual Studio and in my report I have to write the numbers of my data base in words. For example : "55" has to be written "fifty five".

I have to do that in two other langages: french and dutch.

But I don't know at all how to do that. I never used reporting service before. Can you help me?

Regards

The requirement you present is not a simple one and certainly is not something that supported out of the box.

Your best option is to create a table with the range of numbers you wish translated and a language code column and get some resource to generate the translations manually.

Unless you want to get into custom coding to parse the number and translate it into words in the desired language on the fly, which although an interesting prospect I would certainly not recommend.

|||

Hello Oolon,

I had the same requirement, but I had in english. I did not create a table insted I created two functions and called one from another. First function has all the table values and the second has all the logic.

http://www.planet-source-code.com/vb/scripts/ShowCodeAsText.asp?txtCodeId=439&lngWId=5

Hope this helps.

|||

This code is perfect

Thank you

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 : 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 formatting

Here's a quickie - I have a stored procedure which returns a list of numbers.
I want the output formatted with commas so 95,000 instead of 95000 - how
would I do that?"Joe" <Joe@.discussions.microsoft.com> wrote in message
news:F11D15E1-2FFB-4ADE-85C3-F5C97E278214@.microsoft.com...
> Here's a quickie - I have a stored procedure which returns a list of
numbers.
> I want the output formatted with commas so 95,000 instead of 95000 - how
> would I do that?
Do it at the client, not at the server.|||Joe,
here is an attempt at doing it, this is definitely an overkill and can
reduce the performance in case you have a lot of data coming back,
Select
LEFT(Convert(varchar(12),Convert(money,95000),1),LEN(Convert(varchar(12),Convert(money,95000),1)) - 3)
I would agree with Greg it will be simpler & more efficient on the
front-end. But I just had to try and do it in the backend :)
Enjoy,
Rakesh Ajwani
MCSD, MCSD.NET
"Greg D. Moore (Strider)" wrote:
> "Joe" <Joe@.discussions.microsoft.com> wrote in message
> news:F11D15E1-2FFB-4ADE-85C3-F5C97E278214@.microsoft.com...
> > Here's a quickie - I have a stored procedure which returns a list of
> numbers.
> > I want the output formatted with commas so 95,000 instead of 95000 - how
> > would I do that?
> Do it at the client, not at the server.
>
>