Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I apply Alltrim to a filtered field?
Message
 
 
À
15/05/2001 19:21:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Divers
Thread ID:
00507626
Message ID:
00508766
Vues:
27
>Hi. I am using Stonefield Query for my find screen. When I press the find button, Stonefield Filter screen is invoked. (Good!). I have an unusual circumstance on my Customer and Vendor numbers. My field can contain either numbers or alpha characters - but not both.
>
>The index I usually use on this field is:
>IIF(VAL(custno)=0,custno,PADL(STR(VAL(custno),10),10))
>
>When I enter a Filter like: Customer (field name from lookup) EQUALS '10', I get no records. I must enter it like ' 10' in order to get a match. This is too hard to remember for the clients, so I want to put some custom code in the field screen to change the search expression with respect to custno or vendno (field names) to the above mentioned expression. Where do I put this code?
>
>TIA
>
>Sandi Cassidy

Sandi,
Instead of using STR(), use TRANSFORM. It does an implicit ALLTRIM() when converting the numeric values. It will also automatically take decimal places into account so you don't have to allocate them as you do with STR().

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform