Hi!
Does anybody know how a currency value can be formated so that the
currency symbol (=A3 or $) is not shown?
/erikShould be able to right-click the textbox/cell and choose properties.
Then click on the Format tab. Under format code choose to format as a
number rather than currency (code will be N, I believe).
On Feb 16, 6:47 am, "inga2005" <e...@.liffner.se> wrote:
> Hi!
> Does anybody know how a currency value can be formated so that the
> currency symbol (=A3 or $) is not shown?
> /erik
Showing posts with label shown. Show all posts
Showing posts with label shown. Show all posts
Wednesday, March 28, 2012
remove control codes from database
I have control codes in the description field as shown below. I need to
create a report of only code and description without the \rtf... etc
Is there any way I can remove these from my final output using SQL?
Any help is greatly appreciated.
modcode longdescription
lastupdate
updateid
--
----
----
----
--
-
--- --
1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
\par }Could you post a sample of what you want your data to look like?
"mcp111" wrote:
> I have control codes in the description field as shown below. I need to
> create a report of only code and description without the \rtf... etc
> Is there any way I can remove these from my final output using SQL?
> Any help is greatly appreciated.
> modcode longdescription
>
> lastupdate
> updateid
> --
> ----
----
----
--
--
> --- --
> 1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
> \viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
> \par }
>|||mcp111
I used a UDF to strip out the rtf tags.
The UDF is shown below..
BE WARNED ! this is a rough and ready fix for a problem I had and will NOT
cope with all posible rft tags but it may be useful as start for you.
Cheers
David.
---
CREATE FUNCTION Strip_RTF_Tags ( @.LineIn Varchar(4000)
)
RETURNS Varchar(4000)
AS
BEGIN
DECLARE @.BraceCount Int
DECLARE @.StartCount Int
DECLARE @.EndCount Int
DECLARE @.LoopCount Int
declare @.InText Int
DECLARE @.S varchar(4000)
DECLARE @.P1 Int
SET @.BraceCount = 0
SET @.StartCount = 0
SET @.EndCount = 0
SET @.LoopCount = 1
SET @.S = ''
SET @.InText = 0
WHILE @.LoopCount <= Len(@.LineIn)
BEGIN
If SUBSTRING(@.LineIn, @.LoopCount, 1) = '{'
BEGIN
SET @.BraceCount = @.BraceCount + 1
END
If SUBSTRING(@.LineIn, @.LoopCount, 1) = '}'
BEGIN
SET @.BraceCount = @.BraceCount - 1
END
If (SUBSTRING(@.LineIn, @.LoopCount, 1) = ' ')
AND (@.BraceCount = 1)
AND (@.InText = 0)
BEGIN
SET @.StartCount = @.LoopCount +1
SET @.InText = 1
END
If (SUBSTRING(@.LineIn, @.LoopCount, 1) = '')
AND (@.BraceCount = 1)
AND (@.InText = 1)
BEGIN
SET @.EndCount = @.LoopCount
SET @.S = @.S + SUBSTRING(@.LineIn, @.StartCount, @.EndCount -
@.StartCount)
SET @.InText = 0
END
SET @.LoopCount = @.LoopCount + 1
END
-- SET @.S = Cast(@.Startcount as varchar) + ' '+ Cast(@.EndCount as
varchar)
Return @.S
END
---
"mcp111" <mcp111@.discussions.microsoft.com> wrote in message
news:960CBFF0-80B1-4E25-9010-9F14C8CE8C6D@.microsoft.com...
>I have control codes in the description field as shown below. I need to
> create a report of only code and description without the \rtf... etc
> Is there any way I can remove these from my final output using SQL?
> Any help is greatly appreciated.
> modcode longdescription
>
> lastupdate
> updateid
> --
> ----
----
----
--
--
> --- --
> 1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
> \viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
> \par }
>|||Your best bet is an application dedicated to stripping RTF codes from RTF
data. SQL Server doesn't know anything about RTF, and in order to have SQL
Server do this, you'd have to re-invent the wheel...
"mcp111" <mcp111@.discussions.microsoft.com> wrote in message
news:960CBFF0-80B1-4E25-9010-9F14C8CE8C6D@.microsoft.com...
>I have control codes in the description field as shown below. I need to
> create a report of only code and description without the \rtf... etc
> Is there any way I can remove these from my final output using SQL?
> Any help is greatly appreciated.
> modcode longdescription
>
> lastupdate
> updateid
> --
> ----
----
----
--
--
> --- --
> 1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
> \viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
> \par }
>sql
create a report of only code and description without the \rtf... etc
Is there any way I can remove these from my final output using SQL?
Any help is greatly appreciated.
modcode longdescription
lastupdate
updateid
--
----
----
----
--
-
--- --
1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
\par }Could you post a sample of what you want your data to look like?
"mcp111" wrote:
> I have control codes in the description field as shown below. I need to
> create a report of only code and description without the \rtf... etc
> Is there any way I can remove these from my final output using SQL?
> Any help is greatly appreciated.
> modcode longdescription
>
> lastupdate
> updateid
> --
> ----
----
----
--
--
> --- --
> 1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
> \viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
> \par }
>|||mcp111
I used a UDF to strip out the rtf tags.
The UDF is shown below..
BE WARNED ! this is a rough and ready fix for a problem I had and will NOT
cope with all posible rft tags but it may be useful as start for you.
Cheers
David.
---
CREATE FUNCTION Strip_RTF_Tags ( @.LineIn Varchar(4000)
)
RETURNS Varchar(4000)
AS
BEGIN
DECLARE @.BraceCount Int
DECLARE @.StartCount Int
DECLARE @.EndCount Int
DECLARE @.LoopCount Int
declare @.InText Int
DECLARE @.S varchar(4000)
DECLARE @.P1 Int
SET @.BraceCount = 0
SET @.StartCount = 0
SET @.EndCount = 0
SET @.LoopCount = 1
SET @.S = ''
SET @.InText = 0
WHILE @.LoopCount <= Len(@.LineIn)
BEGIN
If SUBSTRING(@.LineIn, @.LoopCount, 1) = '{'
BEGIN
SET @.BraceCount = @.BraceCount + 1
END
If SUBSTRING(@.LineIn, @.LoopCount, 1) = '}'
BEGIN
SET @.BraceCount = @.BraceCount - 1
END
If (SUBSTRING(@.LineIn, @.LoopCount, 1) = ' ')
AND (@.BraceCount = 1)
AND (@.InText = 0)
BEGIN
SET @.StartCount = @.LoopCount +1
SET @.InText = 1
END
If (SUBSTRING(@.LineIn, @.LoopCount, 1) = '')
AND (@.BraceCount = 1)
AND (@.InText = 1)
BEGIN
SET @.EndCount = @.LoopCount
SET @.S = @.S + SUBSTRING(@.LineIn, @.StartCount, @.EndCount -
@.StartCount)
SET @.InText = 0
END
SET @.LoopCount = @.LoopCount + 1
END
-- SET @.S = Cast(@.Startcount as varchar) + ' '+ Cast(@.EndCount as
varchar)
Return @.S
END
---
"mcp111" <mcp111@.discussions.microsoft.com> wrote in message
news:960CBFF0-80B1-4E25-9010-9F14C8CE8C6D@.microsoft.com...
>I have control codes in the description field as shown below. I need to
> create a report of only code and description without the \rtf... etc
> Is there any way I can remove these from my final output using SQL?
> Any help is greatly appreciated.
> modcode longdescription
>
> lastupdate
> updateid
> --
> ----
----
----
--
--
> --- --
> 1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
> \viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
> \par }
>|||Your best bet is an application dedicated to stripping RTF codes from RTF
data. SQL Server doesn't know anything about RTF, and in order to have SQL
Server do this, you'd have to re-invent the wheel...
"mcp111" <mcp111@.discussions.microsoft.com> wrote in message
news:960CBFF0-80B1-4E25-9010-9F14C8CE8C6D@.microsoft.com...
>I have control codes in the description field as shown below. I need to
> create a report of only code and description without the \rtf... etc
> Is there any way I can remove these from my final output using SQL?
> Any help is greatly appreciated.
> modcode longdescription
>
> lastupdate
> updateid
> --
> ----
----
----
--
--
> --- --
> 1 {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcha
rset0 MS Sans Serif;}}
> \viewkind4\uc1\pard\lang1033\f0\fs17 A normal healthy patient
> \par }
>sql
Monday, March 12, 2012
Remote Query
Hi,
I would like to know why SQL Profiler return the output shown below and is
it possible to tune and avoid this problem?
declare @.P1 int
set @.P1=7
exec sp_prepexec @.P1 output, N'@.P1 varchar(255)', N'SELECT Tbl1019."Name"
Col1075,Tbl1019."PhoneNumber" Col1080,Tbl1019."Pager"
Col1081,Tbl1019."FirstName" Col1076,Tbl1019."LastName" Col1077 FROM "Users"
Tbl1019 WHERE @.P1=Tbl1019."Email"', 'aaa1@.test.com'
select @.P1
exec sp_execute 7, 'aaa2@.test.com'
exec sp_execute 7, 'aaa3@.test.com'
...
exec sp_execute 7, 'aaa10@.test.com'
If I have a page which need to display 10 users then it will show 10 times.
Thanks,
KennyThats the way your provider executes it at the SQLServer side, there is
AFAIK no way to change it, unless you code your Exec string on your own
in your application.
What data provider are you using ?
HTH, Jens Suessmeyer.|||I am not talking about any application but just the T-SQL.
You can simulate this problem by just setup 2 database server. DB1 have
users data. DB2 have Jobs data. You need to have a view vwUser in DB2 which
select the user data from DB1 e.g. FROM DB1.sd_db01.dbo.Users.
After that you try to execute SELECT * FROM vwUser and capture info from
profiler then you can see the problem.
Thanks,
Kenny
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1126854669.318346.268580@.g44g2000cwa.googlegroups.com...
> Thats the way your provider executes it at the SQLServer side, there is
> AFAIK no way to change it, unless you code your Exec string on your own
> in your application.
> What data provider are you using ?
> HTH, Jens Suessmeyer.
>
I would like to know why SQL Profiler return the output shown below and is
it possible to tune and avoid this problem?
declare @.P1 int
set @.P1=7
exec sp_prepexec @.P1 output, N'@.P1 varchar(255)', N'SELECT Tbl1019."Name"
Col1075,Tbl1019."PhoneNumber" Col1080,Tbl1019."Pager"
Col1081,Tbl1019."FirstName" Col1076,Tbl1019."LastName" Col1077 FROM "Users"
Tbl1019 WHERE @.P1=Tbl1019."Email"', 'aaa1@.test.com'
select @.P1
exec sp_execute 7, 'aaa2@.test.com'
exec sp_execute 7, 'aaa3@.test.com'
...
exec sp_execute 7, 'aaa10@.test.com'
If I have a page which need to display 10 users then it will show 10 times.
Thanks,
KennyThats the way your provider executes it at the SQLServer side, there is
AFAIK no way to change it, unless you code your Exec string on your own
in your application.
What data provider are you using ?
HTH, Jens Suessmeyer.|||I am not talking about any application but just the T-SQL.
You can simulate this problem by just setup 2 database server. DB1 have
users data. DB2 have Jobs data. You need to have a view vwUser in DB2 which
select the user data from DB1 e.g. FROM DB1.sd_db01.dbo.Users.
After that you try to execute SELECT * FROM vwUser and capture info from
profiler then you can see the problem.
Thanks,
Kenny
"Jens" <Jens@.sqlserver2005.de> wrote in message
news:1126854669.318346.268580@.g44g2000cwa.googlegroups.com...
> Thats the way your provider executes it at the SQLServer side, there is
> AFAIK no way to change it, unless you code your Exec string on your own
> in your application.
> What data provider are you using ?
> HTH, Jens Suessmeyer.
>
Subscribe to:
Posts (Atom)