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

Find jobs that match a patern of numbers and letters

Status
Not open for further replies.

aarondewberry

IS-IT--Management
Jul 20, 2005
148
GB
All

I am trying to write a query in the query panel to pull back jobs where the bill account number starts with two numbers then two letters then two numbers.
This combination of numbers and letters can vary but I need only the accounts with that combination eg. 22ab56
Are there any wildcards I can use?

Thanks
 
Please state the database you are using and we will work out a nice expression...

Ties Blom

 
I pull the bill account number from the accounts database

Thanks
 
I think this a little beyond using wildcard expressions.
With a little creativity you can use the ORACLE function ASCII to test each position in the string:

position1:

ASCII(SUBSTR(ACCOUNT_NUMBER,1,1))

For a value in the range 0-9 the ASCII value ranges between 48 - 57.

So, create 6 universe objects for the 6 positions in the string.

The resulting expression will be:

Code:
ASCII(SUBSTR(ACCOUNT_NUMBER,1,1)) BETWEEN 48 AND 57 
AND
ASCII(SUBSTR(ACCOUNT_NUMBER,2,1)) BETWEEN 48 AND 57  
AND
ASCII(SUBSTR(ACCOUNT_NUMBER,3,1))NOT BETWEEN 48 AND 57 
AND
ASCII(SUBSTR(ACCOUNT_NUMBER,4,1))NOT BETWEEN 48 AND 57 
AND
ASCII(SUBSTR(ACCOUNT_NUMBER,5,1)) BETWEEN 48 AND 57 
AND
ASCII(SUBSTR(ACCOUNT_NUMBER,6,1)) BETWEEN 48 AND 57

Or you can define this expression as a filter object in the universe..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top