If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Merging two columns?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-18-11, 20:19
kbeeps kbeeps is offline
Registered User
 
Join Date: Jul 2011
Posts: 1
Merging two columns?

I'm completely new to Crystal, using version 8.5.

I have two name fields, one for individuals and one for companies. I want to merge them into one (no record has data in both fields). I thought I'd be able to do that with concatenate, but it's still only giving me the data from one field. Is there a different formula I should be using?

Thanks!
Reply With Quote
  #2 (permalink)  
Old 07-18-11, 20:23
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
i've never used crystal, but i believe it uses SQL, right?

try the COALESCE function, which returns the first non-null parameter value reading from left to right

so COALESCE(field1,field2) will return field1 if field1 is not null, and field2 if field1 is null

and if both are null, then of course it returns null, unless you add a default value as a 3rd parameter --

COALESCE(field1,field2,'booyah')
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-21-11, 16:29
lpremus lpremus is offline
Registered User
 
Join Date: Nov 2007
Posts: 15
Quote:
Originally Posted by kbeeps View Post
I'm completely new to Crystal, using version 8.5.

I have two name fields, one for individuals and one for companies. I want to merge them into one (no record has data in both fields). I thought I'd be able to do that with concatenate, but it's still only giving me the data from one field. Is there a different formula I should be using?

Thanks!
I suggest upgrading to latest crystal version, then buy a reference book. I had to when I started out. on 8.5 back in 2005. you can use the text object icon and put fields in it. not sure if that is what you want. Also I am on here once in a blue moon. so reply back to me is mute. Yes, SQL is used by the program but the program write the sql (similar to access) for you as long as you know how to do proper ER diagram builds.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On