Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Hi, I need help with this error

Hi, I need help with this error

Hi, I need help with this error


I need help with this error in Crystal Reports.
I'm using the following formula in Field Explorer:

IF {TABLE.CARDNBR} = 123456* then "{TABLE.OWNERNAME}" else " "

I get the Crystal Reports error "A number,currency amount, boolean, date, time, etc. is expected here." over the "then".
I want to display the owner of the card only when the card number begins with 123456 otherwise it should be blank.
I am fairly new using Crystal; any help is appreciated.


RE: Hi, I need help with this error

You must enclose strings in either double or single quotes, no need to put field name in quotes.

Wild card must be used with LIKE

IF {TABLE.CARDNBR} like "123456*" then {TABLE.OWNERNAME} else " "


RE: Hi, I need help with this error

Thank you!
I am now getting the message, "A string is required here.", over {TABLE.CARDNBR}.
Do you know what this needs?
Thanks again.

RE: Hi, I need help with this error

Because that is a number, sorry I assumed it was a string. You cannot use a wild card with a number.

you can convert to text first.

IF totext({TABLE.CARDNBR},0,"") like "123456*" then {TABLE.OWNERNAME} else " "

The extra arguments in totext remove decimal places and thousand separators.


RE: Hi, I need help with this error

It seems there are no longer any errors; however, it does not give me the results I'm looking for.
Example of what I need:
Card Owner Name
12345600000 Joe's Deli

Results of current formula:
Card Owner Name

Do you know why it is not supplying the correct info?


RE: Hi, I need help with this error

Create another formula

totext({TABLE.CARDNBR},0,"") place this alonside data and see what is returned

RE: Hi, I need help with this error

The new formula is returning the remaining 7 numbers of the card.

Card Results
123456004567891 4567891


RE: Hi, I need help with this error

Card: 123456004567891

Results: 4567891

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close