Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenating Multiple String Fields

Status
Not open for further replies.

stancer

Programmer
Jan 16, 2003
27
US
I have an Access 2000 database that I am reporting on via an ODBC connection. In the report I want to concatenate 6 string fields comprising the description of a person:
Sex | Race | Height | Weight | Hair | Eyes
where 1 or more of the fields have no data.

I started by using a formula like this:
If IsNull({Sex}) then
"?" + {Race}+"/"+{Height}}+"/"+{{Weight}}+"/"+{{Hair}}+"/"+{{Eyes}
Else
If IsNull({Sex}) and IsNull({Race}) then
"?" + "?"}+"/"+{{Height}}+"/"+{{Weight}}+"/"+{Hair}}+"/"+{{Eyes}
...and so forth, to produce a report field that looks like this for example: M/W/5-10/160/BR/BL

I also tried using the & operator, but got the same results.
I am wondering if there is a better way than having to use multiple IF...THEN statements to account for every possible combination of fields with no data and fields with data. I thought of trying to use variables to accomplish this, but am not familiar enough with variables to make it happen, or if this is possible. One more handicap I face: our IS department didn't install Crystal Help and I see no hope of getting it soon, so I am operating a bit in the dark.
I am using Crystal Reports 8.5 on Windows 2000. Anyone got any ideas?

Thanks in advance, you guys are my HELP system until I get this issue of HELP installation resolved!
 
Please disregard... I found an elegant solution posted by 'synapsevampire' on Dec 17, 2002 after a lengthy Advanced Search.

You guys are the greatest!
Where could I give 'synapsevampire' credit for the answer even though he/she didn't reply directly?
 
Dear Stancer,

You can star his original post and post another reply to it thanking him for the solution to this thread and post this thread number by copying (higlight and do a ctrl-c) as in
thread767-487395.

Best regards sv,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Nope,

Just answered the posed question.

Just checking email real quick as I just got into Vancouver (doing a week of training here) and it is 3 am my time on monday morn - no sleep for the weary...

Hope you get your beer, keep in touch.

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top