Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2011
    Posts
    1

    Unanswered: 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!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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')
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •