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!

Excluding Items from a report

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello Again

Sorry about the constant questions I must apologise I am new to this program.

Having now sorted the time problem I now need to exclude certain items from my report

it is as below

{version_jazchar.data_type} = 1 and
{dir_common.name} = "GEN TASTERS READY" and
{file_common.edit_time} >= Dateadd("h",-5,CurrentDateTime)

I need to add a line to exclude anything in a field user_table.user07 that contains Brief,schedule,press etc

Thanks in Advance

Richard
 
and not ({field user_table.user07} in

This will work if you are looking to exclude the exact strings of "Brief", "Schedule" and "Press". If you want to exclude anything that contains this string you will need to use the Instr() function as follows:

Instr({StringToBeSearched},"SearchString1")=0

Instr() returns 0 if the string is not found, or the starting position of the string if it is found.



Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
If you're concerned with performance, as your adding criteria to the record selection criteria, make sure that the criteria is passed to the database in the where clause.

This is done by selecting Database->Show SQL Query

The above solution doesn't pass the SQL, so the report will have to do the work, which may cause performance issues.

If you are looking for the entire field contents = a certain string, just use a literal search:

av_rpt_ATSStatementOfAccount."chvAddr1" in ['Brief','Press']

If you're going to search the field for a string, create a SQL Expression to search the string, and then reference it in the record selection criteria, the following is a SQL Server example:

%MySQLExpression1
charindex('Brief',av_rpt_ATSStatementOfAccount."chvAddr1")

%MySQLExpression2
charindex('press',av_rpt_ATSStatementOfAccount."chvAddr1")

Then you would reference these in the record selection criteria by using:

(%MySQLExpression1 = 0
or
%MySQLExpression2 = 0)

-k kai@informeddatadecisions.com
 
Hello

Before the first reply came in I messed around and came up with the following which seems to work

{user_table.user07} <> 'BRIEF' and
{user_table.user07} <> 'PRESS' and
{user_table.user07} <> 'QUOTE' and
{user_table.user07} <> 'SCHEDULE' and
{user_table.user07} <> 'PEOPLE'

Is this a bad way of doing it ?
 
not ({field user_table.user07} in [&quot;BRIEF&quot;,&quot;PRESS&quot;,&quot;QUOTE&quot;,&quot;SCHEDULE&quot;,PEOPLE&quot;])

This is what I thought I had put into the first post but I left out the last part.


Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top