Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seting field width on calculated fields.
Message
From
31/03/2000 18:15:18
 
 
To
31/03/2000 18:11:11
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00353697
Message ID:
00353704
Views:
10
>Terry,
>
>>I have an SQL Select driven report in which I use a custom function to calculate one of the fields. The returned values are typically between 0 & 31 ( care days ). The problem that arrises ( as you have no doubt already sermised) is that the early returns are 1 digit 0 - 9 and later when one comes allong that is double digit 10 - 31 the table receives * for out of range. How do I squach this pest.
>
>I assume you are returning a numeric value from the custom function. I just tried this:
SELECT *, dsnum() AS numb FROM labels
>DISP STRU
>
>DSNUM.PRG contains:
>RETURN 1
You get a 1-digit numeric field, but changing to
"RETURN 0001"
you get a 4-digit numeric field.

Cool, Thanks I hoped it would be something like that. I just forced it with 100 - caredays() AS CareDays and then did a REPLACE ALL CareDays WITH 100 - CareDays - VERY BAD CODE! (Ugly & won't work on cursors). I will use your technique on all future SQLs

Thanks

Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform