Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Report Design
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Report Design
Topic: SQL Expression Error When Concatenating fields
Author
Message
vijayk
Groupie
Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Topic: SQL Expression Error When Concatenating fields
Posted: 28 Mar 2008 at 6:58am
Hi,
I am doing a straight forward concatenation of 2 database fields. It is giving me the following error.
SQL Expression looks like
"A"."TYP_CD"+"A"."JNL_NO"
Error is
Database Connect Error : 42815: SQL0171N The data type, length or value of the argument "1" of routine "+" is incorrect . SQL state 42815.
Does anyone see an issue.?
Thanks,
Vijay
IP Logged
dave_wright
Newbie
Joined: 27 Mar 2008
Location: United Kingdom
Online Status: Offline
Posts: 6
Posted: 28 Mar 2008 at 8:31am
NOTE: Only be using Crystal for a few days so hope this helps ...
I tried the Concatenation with + and found odd results coming back akin to issues I'd seen with MySQL concat vs. concat_ws
The answer I came up with was:
{fn CONCAT({fn IFNULL(`tblperson1`.`SurName`, '')}, ', ',{fn IFNULL(`tblperson1`.`FirstName`, '')}, '. ' , {fn IFNULL(`tblperson1`.`MIddleName`, '')})}
So it puts a blank if a null field but outputs:
Surname, Firstname. Middlename
or at least the value's within those fields.
I could be making it more complicated or I've missed something but the answer I came up with at least works for me
IP Logged
vijayk
Groupie
Joined: 14 Mar 2007
Location: United States
Online Status: Offline
Posts: 53
Posted: 28 Mar 2008 at 9:21am
Thanks . It did work perfectly.
Vijay
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You
cannot
post new topics in this forum
You
cannot
reply to topics in this forum
You
cannot
delete your posts in this forum
You
cannot
edit your posts in this forum
You
cannot
create polls in this forum
You
cannot
vote in polls in this forum
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
KONACAD
© 2004-2026 Brian Bischof. All Rights Reserved.