Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Seting field width on calculated fields.
Message
From
31/03/2000 18:44:49
 
 
To
31/03/2000 18:27:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00353697
Message ID:
00353717
Views:
16
>Terry,
>
>>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
>
>That won't help you very much in itself -- it was just to illustrate that you can return a numeric with more than 1 digit by adding zeroes in front. You will have to do something in your function to return a numeric with more than 1 digit.
>
>Someone else may have a more elegant way, but here are a couple of ideas for starters. Assume you have a local variable in your routine called nRetVal, which holds the number from 1 to 31.
RETURN 99-99+nRetVal
gives you an 11-digit numeric in the SELECT, and
RETURN VAL(STR(nRetVal,2))
gives you a 5.2 numeric.

I figured that. I tried the manipulation in the function but it didn't work. What I settled on was 100 + caredays() - 100 AS CareDays. That gave me a 5 0.
Also, manipulation in the caredays function hides the purpose of the work. Putting the manipulation in the SQL code makes it easy to see and explain the whys to other programmers.

Thanks for your great help.

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