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

Select Expert Operators How 1

Status
Not open for further replies.

timmahan

Technical User
Apr 23, 2007
18
US
Using CR XI

I have some stock numbers that I need to select. The ones I want start with a "P" and that's simple enough to select
{sales.stockno} startswith "P"

But some of those end in "A" or "AR" or "AW" or "BR"
So want something like ....
{sales.stockno} startswith "P" and
{sales.stockno}does NOT contain "A" or "AR" or "AW" or "BR"
 
You can use Crystal Right Function

not(right({sales.stockno},2) in ["A", "AR", "AW", "BR"])
and
right({sales.stockno},1) <> "A"

Ian
 
If you don't want it to 'contain' those letters then you might want to use the wildcard operator to indicate that it can be anywhere within the string.

{sales.stockno} startswith "P" and
not({sales.stockno} in ['*A*','*BR*'])

Note: I didn't include 'AR' or 'AW' specifically as you are already omitting any strings with 'A' in them.

'J

 
I Tried this
{sales.stockno} startswith "P" and
not({sales.stockno} in ['*A*','*B*','*C*','*D*])

but the the "AR" and the "AW" are still showing

Not sure are B C D thye simply may Not be in this date range
 
{sales.stockno} startswith "P" and
not({sales.stockno} like ['*A*','*B*','*C*','*D*])

However, this will excluded all stock numbers that contain any of these letters. Is that what you want? If not, please show some sample data and explain a little more.

-LB
 
This is for a car dealer I need 2 reports on Used car sales

I need one for Cars purchased and one for trade ins

Cars that were Purchased start with a "P" such as P3389R

Then Tradeins have and ending of A or several others
such as 13797AR P2905AR 17405AW 15433BR

So some have a leading "P" and some do NOT

There are actually 16 different suffixes
AR AW BR BW CW CR DR A1R A1W A2R A2W AW1 B1R B1W B2R C1W

So to get purchases I need those that begin with a "P" and DO NOT have any of the above suffixes

Then to get tradeins I will need those that DO have the suffixes but May or May NOT have a starting "P"


 
I did it, Thank You all for your assistance

lbass's formula worked best.

For purchased cars
{sales.stockno} startswith "P" and
not({sales.stockno} like ['*A*','*B*','*C*','*D*'])

For Trades
{sales.stockno} like ['*A*','*B*','*C*','*D*']
 
How to use Formulas that work in Select expert as a Group Select criteria ?

For purchased cars
not({sales.stockno} like ['*A*','*B*','*C*','*D*'])

For Trades
{sales.stockno} like ['*A*','*B*','*C*','*D*']

I now have 3 reports, Used, Used Purchased, and Used Trades
I want to combine them in one report, so I created a New 3rd group in The Used Table based on {sales.stockno} using "in specified order. 1-Purchased 1-Trades

I want the each select to be the same criteria as above formulas. They work is Select Expert, how to I adapt them to work as Group criteria ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top