Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting from string or numeric to currency
Message
From
13/03/2002 21:59:12
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Converting from string or numeric to currency
Miscellaneous
Thread ID:
00632540
Message ID:
00632540
Views:
43
I’m retrieving a field from a table which will end up as one of two fields depending on the logical value of another field:

IIF(MyTable.lLogical,VAL("0000000000000000.0000"),MyTable.nMyCurrencyField) as Field1, ;
IIF(MyTable.lLogical, MyTable.nMyCurrencyField, VAL("0000000000000000.0000")) as Field2

The problem is that the function VAL as applied returns a field of type n(20, 2) instead of a currency field making me lose the last two decimals and of course a very long field.

Is there a way to obtain a cero value currency field when the other field gets its value from its based currency field? Some kind of a NumericToCurrency() function?

Any advise will be very helpful.

Regards and thanks in advance

Oscar
Next
Reply
Map
View

Click here to load this message in the networking platform