Link to home
Start Free TrialLog in
Avatar of bkpierce
bkpierceFlag for United States of America

asked on

SQL Reporting RTRIM and LTRIM

I have a field in a text box and that combines first and last name. If I didn't use TRIM there was too much space between the first and last name. Now when I add TRIM there is no space between first and last name.

How do I get a space between the first and last name?

here is my current syntax

=(TRIM(Fields!FRSTNAME.Value)+(Fields!LASTNAME.Value))

It prints on the report like this JOHNDOE I want it to show JOHN DOE
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Try this:

=(RTRIM(Fields!FRSTNAME.Value)+ ' ' + RTRIM(Fields!LASTNAME.Value))
Avatar of bkpierce

ASKER

That gives me a syntax error.
SQL-RS.jpg
+ is concatenate operator in TSQL and gave it that by mistake..
Try this

=RTRIM(Fields!FRSTNAME.Value) & ' ' & RTRIM(Fields!LASTNAME.Value)
It's still giving me a syntax error
SQL-RS-2.jpg
ASKER CERTIFIED SOLUTION
Avatar of Raja Jegan R
Raja Jegan R
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Double quote worked pefect. Thank You