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

Want to Get Results That Do Not Contain a Value

Status
Not open for further replies.

kc27

Technical User
Sep 10, 2008
171
US
Hello All

I created a report that almost gets me the information that I want, but I'm not sure how to get the Select Expert to refine my data down to the level I need.

I have a field called "position" that has numerical values of 0 to 63. I want to search for pages that do not have position 1. They may have other position numbers, currently any value from 0 to 63. But I would like my report to show me only pages that do not have a position value "1" associated with them.

Actually the highest position value is most likely unlimited (but realistically would never go beyond 100)

So something like "contains 0 to unlimited but not 1". How do I translate that into a formula?

Thanks in advance for any ideas o nthis.
 
What do you mean by "page"? Do you mean within some group where you have set 'new page after' or 'new page before'?

-LB
 
Hi,
If field is defined as numeric:
use this selection formula

{table.Position} <> 1


If actually an alphanumeric ( string) field use:

{table.Position} <> "1"




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
lbass

Pages are documents that contain the position numbers. I'm trying to generate a report that lists only those pages that do not contain position 1.
 
kc,

If you wish to exclude 1, 11, 21, 31, etc.

Right({Table.field},1) <> 1

Depending on the format of your field and/or Crystal's interpretation, the numeric value may be seen as 123.00 (example) and the above formula would see "0" as the character in the far right position.

Right(Replace(ToText({Table.Field}),".00",""),1) <> "1"

This formula takes the ".00" and removes it before looking for a 1 in the far right position.

Hope this helps,

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Thanks for the help Mike

I did as you suggested, but didn't get the results I'm after. Your syntax may be providing me with what I need, I just need to refine my report further. I think perhaps the structure of my report is flawed. I must have my report set up to deliver the inverse of what I want.

It lists pages and the positions found on the pages. It does not display position one (which is due to the forumula you provided), even if position one exists on the page.

What I am really after is to have the report display only a list of those pages where position number one does not exist on that page.

In other words, check all the pages and the positions on those page. If you find a page that does not have a position 1, then display that page on the report.

Thanks again
 
kc27,

You missed my point. "Page" is not a technical reference to a Crystal Report section. To search for the value, we have to know where to search--within some group. Please identify the group structure of your report. If you are grouping on a field that references a document number, e.g., let's say you have grouped on {table.docno}, then you could create a formula like this:

//{@pos1}:
if {table.position} = 1 then 1

Then you would go to report->selection formula->GROUP and enter:

sum({@pos1},{table.doc}) = 0

This would return those groups that do not contain a position = 1.

Be sure NOT to eliminate {table.position} = 1 in your record selection formula, since you need to be able to test for its presence.

-LB
 
tbass - you are right, I did misread your post, because what you described is exactly what I need to accomplish. I'll give it s shot and let you know how it goes.

Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top