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!

Combine Fields

Status
Not open for further replies.

Hepburn

Technical User
Jul 4, 2007
9
US
Hi:

I'm using Crystal Reports X with Visual Studio 2005 and am programming in C#.

Can I do this...

I want to create a formula called Event. In the Event formula, I want to combine two fields. I have the following formula and am grouping by Event:

StringVar event;

if not isnull({Events.CRED_HLDR_EVENT_DATE_TIME}) then
(
event := UpperCase(cstr({Events.CRED_HLDR_EVENT_DATE_TIME}, "MM/dd/yyyy") + {Events.CRED_EVENT_TYPE_NAME} + {Events.COMMENT_TEXT}) + Chr(13)
)
else
if not isnull({ExamHist.EXAM_DATE_TIME}) and not isnull({ExamHist.PART_NAME}) then
(
event := UpperCase(cstr({ExamHist.EXAM_DATE_TIME}, "MM/dd/yyyy") + {ExamHist.PART_NAME} + "EXAM" + cstr({ExamHist.PART_SCORE})) + Chr(13)
)

My results are only showing results from the first if statement. Any ideas??

Thanks much!
 
i Think you should swap around your Ifs and put this one first

if not isnull({ExamHist.EXAM_DATE_TIME}) and not isnull({ExamHist.PART_NAME}) then

and this one second

if not isnull({Events.CRED_HLDR_EVENT_DATE_TIME}) then


_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top