Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Parameterized View With Integer?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00058639
Message ID:
00058849
Vues:
39

>>I have a parameterized view with two view parameters. One parameter is a string, the other an integer. I'd like to be able to select all records in the view, but when I leave the integer view parameter blank I get a "data type mismatch" error. Obviously, this is because the empty vp is being converted to a string. How do I make the view so that I don't have to put a value in the integer view parameter?
>
>What about converting the single integer view parameter into two integers that form a range search:
>
>WHERE column = ?vp_integer
>
>becomes
>
>WHERE column BETWEEN ?vp_integer1 AND ?vp_integer2.
>
>If you want to find a specific value set vp_integer1 = vp_integer2 = value
>To ignore the integer view parameter set vp_integer1 to something very small and vp_integer2 to something very large.
>
>-Mike


Actually, I solved this problem by using an expression in the field for the view parameter. So, instead of : "address.ad_key = ?vp_key" I now have "Alltrim(Str(address.ad_key)) = ?vp_key". Works great. If I leave my view parameters blank, all records are selected.

Michael G. Emmons
memmons@nc.rr.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform