Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looking for a better way
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00305584
Message ID:
00305598
Vues:
25
If these are the only codes you have, you can write a small CarCodeToCarName function and call it in your SQL statement:

Select CarCodeToCarName(MyTable.CarCode) from MyTable into etc...
function CarCodeToCarName
lparameter tcCarCode
local lcCarName
do case
case tcCarCode = 1
   lcCarName = "Ford"
case tcChevy
   lcCarName = "Chevy"
case etc
otherwise
   lcCarName = "Unknown"
endcase
*-- padr is necessary because the size of the field 
*   will be set by VFP based on the first record
*   and we want it to be large enough to hold any value.
return padr(lcCarName, 20)
Anyway, having a table for car types is probably a better solution :)

Vlad

>For example my report shows a column of codes as in 1, 3, 6, 4, 6
>1 = Ford
>2 = Chevy
>3 = Buick
>4 = Pontiac
>5 = Cadillac
>6 = Chrysler
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform