General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Converting from string or numeric to currency
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only