Results 1 to 5 of 5

Thread: Currently bangging my head on the table

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    28
    I am totaly new at using Crystal Report, so far I have been able to do some of the basics. If it is possible, I need to know how to put all of the selected data from one field into the field separated by a comma. like this , "data1, data2, data3,..."
    hope this makes sense.

    Using VB 6.0 SP 3
    Bed goes up, bed goes down

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    I think I know what you want; if not, please re-post and clarify. Does the following example apply to your problem? Let's say there are two fields in the recordset that is being input to your report: FirstName and LastName. On the report detail line, instead of these two separate fields, you want one field: LastName, FirstName. To do this, in Crystal Reports, you would do Insert -> Formula. The "New Formula" window comes up, you name it, then the "Edit Formula" window comes up. For "Formula text" you would type something like this:
    TrimRight({MyRecSet.LastName})+", "+TrimRight({MyRecSet.FirstName})
    Then hit the Check button, then if all is well, hit the Accept button. You would then use this formula field instead of the two separate fields on your detail line.
    "It's cold gin time again ..."

    Check out my website here.

  3. #3
    Hyperactive Member
    Join Date
    Apr 2000
    Location
    Sudbury, Ontario, Canada
    Posts
    274
    In your query string if (you're using one) concatenate your fields.

    SELECT data1 & ', ' data2 & ', '" & data3 as Field1 FROM table1

    then you'll have one field called Field1 in your report

    Or

    In your report create a formula that concatenates the fields.




  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    28

    That's sort of it

    BruceG, thanks for replying

    Instead of combinning two different fields, I want to combine all the data from the recordset into one field. So if my recordset has only first names in it, I want to display all of the first names at once.
    ex. "firstname1, firstname2, firstname3,..."
    Does this make sense?
    Using VB 6.0 SP 3
    Bed goes up, bed goes down

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Maybe you could just export your database to a comma-delimited text file and parse it as a plain text file.

    I think fields are delimited by commas and records are delimited by newlines. I think.
    Harry.

    "From one thing, know ten thousand things."

Posting Permissions

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



Click Here to Expand Forum to Full Width