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

select based on certain characters

Status
Not open for further replies.

Cretin

Technical User
Jan 2, 2003
194
US
I am using crystal reports 8.5 I am accessing a database. Basically is what I am trying to to is only print records where a text file does not contain the words Hardware inventory. The 2 fields I am using is custid and notes, The report will look as follows:

custid notes

I want to only print records where the notes field does not contain the words "hardware inventory" or "HW Inventory". Is this doable? The book I am trying to use does not have anything on that.

Cretin
 
What does a text file have ot do with a database?

Are you saying that you have a data type of MEMO field?

I'll assume that you're new to databases and reporting based on your post so I'll try to help you understand what you need to know, and what you need to provide:

When you ask about a database, state the database being used, and which connectivity. If you don't know, find out, it's important.

If you state that you have fields, state their data types.

It's also a good idea to shwo example dtaa and expected output.

If the field is not a MEMO type, you can use:

Report->Edit selection formula->Record and palce something like:

not({table.note} like "*" & "Hardware inventory" & "*")

If it's a memo field, you''ll want to convert it, the best palce being on the database, though you might be able to use a SQL Expression.

Hopefully you can figure it out from the above, if not, please take some time to supply technical information.

-k
 
What I would do if it is an Oracle database

Click on database->Show SQL Query and add the following to the and

and(
lower({table.notes}) like '%hw inventory%' or
lower({table.notes}) like '%hardware inventory%'
)

-lw
 
It is a database called heat and the field is a memo field. Is all I need to know is there a way to use CR 8.5 to pick text characters out of a memo field and report based on tose characters.

Cretin
 
Are you able to create SQL expressions? The syntax varies, but try something like {%memo}:

substr(table.`memo`,1,254)

If your notes field has less than 254 characters, you can then use a record selection formula like:

not({%memo} like "*hardware inventory*") and
not({%memo} like "*HW inventory*")

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top