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!

CR String Condition Needed to display "blank" value

Status
Not open for further replies.

davismar

IS-IT--Management
Apr 1, 2010
85
US
For my Crystal Report, I am trying to display a string value which is "blank". For example, when I preview the report in Crystal, the field name is:
tblSONotesTopic

Therefore, I would like to only show on the report only equal to "nothing" or
tblSONotesTopic not equal to:

Checklist
Contract Change
Email Received From Client
Follow Up Phone Call
Note From Contractor
Note From Customer
SO Priority Change
SO Tech Change
Status Change
Work Performed Change
 
In the record selection formula have you tried:
tblSONotesTopic is not null or tblSONotesTopic<>''

This is all dependant upon what the actual field contains ie is it just blank or does it contain a value of a single space.
 
ShortyA

When adding this as the formula, I receive the following error message:

"The remaining text does not appear to be part of the formula".

Can you further define the correct formula, including parenthesis and how to define the <> for all of the conditions above (i.e. would there be commas between Checklist, Contract Change or some other symbol?

I don't know if the actual field is considered "blank" or if it contain a value of a single space. How would I go about determining this?



 
ShortyA:

You used SQL syntax, not Crystal.

Try not(isnull(tblSONotesTopic))or tblSONotesTopic<>""
 
KRAY4660

Now, I receive (tblSONotesTopic)
field name is not known?

Are the parenthesis and {} correctly noted in this formula?
 
You will need to insert the field name where it shows {MyFieldName} below. Perhaps select the text in the record selection formula and then double-click on the actual field from the list above it in the formula editor to ensure you get the full field name.

not(isnull({MyFieldName}))or {Myfieldname}<>
 
ShortyA

Thanks. So one more question....at the end of the formula, where it shows <> "", what does this command mean?

Do I need to add the criteria individually for the table references between the parenthesis?

For example:

not(isnull({tblSONotesTopic}))or {tblSONotesTopic}<>"Status Change"


 
the {Myfieldname}<>"" is checking for an empty string. Depending on the database or an application. The database will sometimes have what is called an empty string or NULL. It is normally best to check for both cases.
 
If IsNull({tblSONotes.Topic})
and{tblSONotes.Topic} = "FALSE"
then {tblSONotes.Topic} <> "Service Complete" or
If IsNull({tblSONotes.Topic})
and{tblSONotes.Topic} = "FALSE"
then {tblSONotes.Topic} <> "Status Change"

ABOVE is my current formula.
Now, this is what I want to do:

@TSNOTE:

If the result of the above formula = "False", then
I want to remove all fields pertaining to the records on the report that show up under the false condition.

See attached report!

Any help you can provide would be greatly appreciated!

THANKS!
 
 http://www.mediafire.com/?ic1su4ci46wrupm
Use a record selection formula like this:

isnull({tblSONotes.Topic}) or
trim({tblSONotes.Topic}) = "" or
not({tblSONotes.Topic} in ["Checklist","Contract Change","Email Received From Client","Follow Up Phone Call","Note From Contractor",
"Note From Customer","SO Priority Change","SO Tech Change","Status Change","Work Performed Change"])

-LB
 
I entered the above just as written, and I receive the message

"The remaining text does not appear to be part of the formula".

Please advise!
 
Please paste your actual formula into the thread.

-LB
 
isnull({tblSONotes.Topic}) ortrim({tblSONotes.Topic}) = "" or not({tblSONotes.Topic} in ["Checklist","Contract Change","Email Received From Client","Follow Up Phone Call","Note From Contractor","Note From Customer","SO Priority Change","SO Tech Change","Status Change","Work Performed Change"])
 
You need a space in "ortrim" -> "or trim". I don't see any other errors.

-LB
 
LB -

Thank you SOOO much. That fixed it!

Now, I need to know how to change a date that is a string to an actual date.

For Example: String displays:

2011/10/12 00:00:00:00

Change to display 10/12/2011

You rock!
 
date(left({table.stringdatetime},19))

...assuming your datetime is set up like this: yyyy/MM/dd hh:mm:ss:ms, i.e., that the date in your sample is in October.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top