Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Looking for a better way
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00305584
Message ID:
00305598
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform