>Hi all
>I have a cursor with 3 fields: product (c 2),percent (n 6,2) , onefrom (n 6,2).
>The cursor full with data in the two left columns and I have to feel the onefrom according to percent column (for examle if the percent is 20.00(%) the onefrom is 5).
>How can I do it?
Tore has given you the direct answer. However, it's better to not store calculated values like these in your database at all:
- if you ever change the Percent values, you have to remember to update the OneFrom values as well. If they ever get out of "sync" you'll likely have a mess.
- in your case you're storing OneFrom with only 2 decimals of precision. Suppose Percent = 15. Then OneFrom gets stored as either 6.67 or 6.66, either of which is likely to give significant rounding errors in calculations.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up