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!

Filtering Data using 'LIKE '

Status
Not open for further replies.

acr1

Programmer
Oct 12, 2001
73
NZ
Team
I am trying to extract data using the LIKE predicate in Seagate Info using SQL qry.

e.g....and job.Customer_reference LIKE '0206' (02 being the year and 06 being the month).

This is a VarChar2 (text) field in Oracle and may vary as such '0206WB'. Wildcard characters I am using do not want to work (e.g. '0206*'...'0206%')

Any immediate assistance would be greatly appreciated.
TIA
Angus

 
Thanks for your comments but still no Joy...
Are their any other filter options available. ....
TIA
 
I think it should be like "0206*". I saw no reference to using % with the like operator.

Also note the double quotes. I have heard reports of intermitent problems with single quotes. Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
One again thanks for all your efforts... but still no Joy
Have tried '0206%','0206*', "0206*" and "0206%"

Any further comments..??

Where possible I use TOAD to check my SQL and have tested the above in in LIKE statements in SQL qry.

TIA

 
The syntac I used was not for use in a SQL query, it is for use in a crystal reports formula. I misread your earlier posts, I cannot help you in SQL.

Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
I am a true SQL novice, but I jusst successfully wrote a sql query in Crystal SQL designer using th following:

SELECT
ARCUSFIL_SQL.`Cus_No`,
ARCUSFIL_SQL.`Cus_Name`,
ARCUSFIL_SQL.`City`,
ARCUSFIL_SQL.`State`,
ARCUSFIL_SQL.`Zip`
FROM
`ARCUSFIL_SQL` ARCUSFIL_SQL
WHERE
ARCUSFIL_SQL.`Cus_Name` like 'A%'

It correctly returned all Customers with names that start with "A".
Software Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
dgillz
Thanks for your reply... am appreciative,....but still no go

I can get all data with a '0206' except those with a '0206RS'...

The field is a text field (as stated in first post) so surely the chars should be treated as alpha-nummeric, 'text'..??

Any field formatting required to extract the data..??

TIA



 
dgillz

Have it working now with % as the wildcard.
My apologies..Grabbed the wrong data set

Thankyou so much for all your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top