Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Trim a string fields

Author  Topic 

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-10-17 : 23:23:30
Guys,

what happen with this string. i tried to use trim, ltrim, rtrim but the result is still the same there is no changes.

the result should be like this:
HTC INCREDIBLE Receiver Speaker (36H00899-00M) P/N : 36H00899-00M

not this one.
HTC INCREDIBLE Receiver Speaker (36H00899-00M)
P/N : 36H00899-00M

thank you in advance.

jov




visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-18 : 00:26:59
try REPLACE(REPLACE(string,CHAR(10),''),CHAR(13),'')

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-10-18 : 05:14:20
Hi Visakh16,

I forgot that this is from SSRS report.
Here is the field from SSRS.

=Fields!ITEMNAME.Value

Thanks,

JOV
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-18 : 05:23:43
use the replace in reports

=Replace(Fields!ITEMNAME.Value,vbCrLf,"")


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-10-18 : 05:44:31
Thank you very much. visakh16..
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-18 : 07:34:43
wc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Villanuev
Constraint Violating Yak Guru

478 Posts

Posted - 2011-10-18 : 22:32:30
Hi Visakh,

i tried this morning but still the result is still the same.
even widen or strech the textbox. where i could see in SSRS report
if how many char displayed.

HTC INCREDIBLE Receiver Speaker (36H00899-00M) P/N : 36H00899-00M


HTC INCREDIBLE Receiver Speaker (36H00899-00M)
P/N : 36H00899-00M

ANother Query

anyway, i have additional query.
I would like to removed this P300-1110- and -U
i will retain only INCREDIBLE. can you please help me to do this in script.

This are the data:


SKU
----------
P300-1110-C731-U
P300-1110-INCREDIBLE-U
P300-1710-DROID2GLBL-U
P300-1710-DROID2-U
P333-4110-TOUR-U

Select substring(t1.sku,11,15)as model--result (TOUR-U)
i want to remove -U




Thank you in Advance.

jov

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-19 : 05:53:57
continued here

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=166894

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -