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

Wildcard???

Status
Not open for further replies.

f0rg3tfu1

MIS
Aug 25, 2004
103
US
Good Morning all...

Crystal 10, SQL Server connect.

Just got word from my boss that we are changing our project ID numbers.

Here is part of the formula I was using...

{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} in ["02009." + "*" + "16." + "*"]

The first six digits remain "02009." ... the next one is variable... the next three remain "16."... then we need three characters that are variable... followed by four zeros.

Something like this 02009.X16.XXX.0000... where the X's represent wildcard characters.

My question is... should I use "*" or "(?)" as the wildcard character? Also, should I enclose both of them in parenthesis or not?

Real quick easy one... thanks everyone!

 
Try:

{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} like ["02009." + "?" + "16." + "*"]

Don't use IN, it won't get converted to a wildcard match, use LIKE.

-k
 
Ahhh theres the problem. Now what if I have a group of several different records? Will the LIKE Function still work?

IE

If {?Choose Clins} = "FFP" then
{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} in ["02009." + "*" + "01.00.0000",
"02009." + "*" + "02.00.0000", "02009." + "*" + "03.00.0000", "02009." + "*" + "04.00.0000",
"02009." + "*" + "05.00.0000", "02009." + "*" + "06.00.0000", "02009." + "*" + "07.00.0000"]

Thanks SV.
 
Since you're using the IN instead of the LIKE, No.

Let me state again, you MUST use the LIKE preduicate to get wildcards to pass:

(
If {?Choose Clins} = "FFP" then
(
{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} like ["02009." + "*" + "01.00.0000"
or
{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} like
"02009." + "*" + "02.00.0000"
or
etc...
)
)

You get the idea.

-k
 
Sorry, omit the bracket in the first example:

(
If {?Choose Clins} = "FFP" then
(
{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} like "02009." + "*" + "01.00.0000"
or
{adq_vw_rpt_ts_sum_craft_by_emplid.Project ID} like
"02009." + "*" + "02.00.0000"
or
etc...
)
)

-k
 
Ok I think Ive got it. So use the OR function instead of commas correct?

SV thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top