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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula Issue

Status
Not open for further replies.

harms

Technical User
Jan 9, 2004
4
US
For some reason, I can't get the following formula to work in Crystal Reports v7.0.0.0.

Subreport/Formula:

@Waitlist
if isnull({WAITING_LISTS.no_sch}) and isnull({WAITING_LISTS.no_sch_standby}) and not isnull({WAITING_LISTS.cd_wl_status})
then "On Waiting List"
else if not isnull({WAITING_LISTS.no_sch}) and isnull({WAITING_LISTS.no_sch_standby})
then {TMS_CODES.tx_tms_decode}+" for Event #"+cstr({WAITING_LISTS.no_sch},0)
else if isnull({WAITING_LISTS.no_sch}) and not isnull({WAITING_LISTS.no_sch_standby})
then "On Standby"+" for Event #"+cstr({WAITING_LISTS.no_sch_standby},0)
else "Not Scheduled"

When I try to validate this formula, I still receive the following message:

"A number, currency amount, boolean or string is expected here"...and the cursor points to this section:

Event #"+|cstr (right before the cstr)

Can you help me figure this out?

jacque harms
515.281.2333
jrharms@midamerican.com
 
What data type is {TMS_CODES.tx_tms_decode}? It looks like this is not a string. I would use the & operator rather than the + operator because the & handles the string conversion for you.
 
Thank you for your suggestion.

Replacing the + with &'s didn't work, now I'm getting a "The remaining text doesn't appear to be part of the formula" message..and the cursor is placed before the &.

{TMS_CODES.tx_tms_decode} is a table that decodes a database field code into an actual description.

This is an LMS Oracle database (TrainingServer) and it has a set of internal codes in the TMS_CODES table. For example there's a code of COMP in a transcript table that means complete and by setting up the decode table, the report can print the description which is COMPLETE. I hope that makes sense. Any other suggestions?

Thanks,
jacque harms =0)
jrharms@midamerican.com
515.281.2333
 
Looks like a wrong data type in the string, try:

@Waitlist
if isnull({WAITING_LISTS.no_sch}) and isnull({WAITING_LISTS.no_sch_standby}) and not isnull({WAITING_LISTS.cd_wl_status})
then "On Waiting List"
else if not isnull({WAITING_LISTS.no_sch}) and isnull({WAITING_LISTS.no_sch_standby})
then
// forgot the CSTR below //
CSTR({TMS_CODES.tx_tms_decode},0)
+
" for Event #"+cstr({WAITING_LISTS.no_sch},0)
else if isnull({WAITING_LISTS.no_sch}) and not isnull({WAITING_LISTS.no_sch_standby})
then "On Standby"+" for Event #"+cstr({WAITING_LISTS.no_sch_standby},0)
else "Not Scheduled"

-k
 
{WAITING_LISTS.no_sch_standby} could this be a string already??? if so remove the cstr function

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top