Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filter condition in Stonefield query
Message
De
15/03/2009 21:17:58
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01388260
Message ID:
01388280
Vues:
39
>Hi everybody,
>
>I'm trying to create a filter on one condition + another condition + (3rd condition or 4th condition) and I could not figure out how to properly find the right parenthesis.
>
>(Primary Person is Yes and Type does not equal Y and ( Campaign equals DIN07 (ask at runtime) ) or Event equals DIN07
>
>It would be nice if we can change the directly in the filter condition field.

You can't use strextract() to match parentheses, because it will find the first occurrence of the right parenthesis. You can use it to find the string thus far (including delimiters), then count by occurs() the number of left and right and left parentheses in the string, then if there are more left and right ones, extend the substring to the next right one until these numbers match. That will give you the whole string within the first parenthesis.

Then if you need to dig deeper, you can do the same on the inner one.

And... I just tried this:

?STREXTRACT("outside (outer (inner) outer again) outside", "(", ")",1, 4)
?STREXTRACT("outside (outer (inner) outer again) outside", "(", ")",2, 4)

As you see, the first one gives me unbalanced parentheses; if so, then I can get the inner by looking for second occurrence. I can then manipulate that inner one, insert back into the outer one etc.

HTH.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform