Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement