Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use MAX() in a calculated field?
Message
 
 
À
26/01/2007 09:32:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01189404
Message ID:
01189579
Vues:
7
>
>Dmitry,
>
>Suggestions - may be wrong, since I do not know SDT
>
>
>(1)
>select eval('max(d2-d1, 0)')
>
>(2) To get rid of the asterisks, force the field length
>select ntom(eval('max(d2-d1, 0)')) from test
>
>works as well
>select mton(eval('max(d2-d1, 0)')) from test
>
>and this also
>select mton(eval('max(ntom(d2-d1), $0)')) from test
>
Gregory,

In SDT I can only specify the calculated field expression. For example, DATE_FLD1 - DATE_FLD2, or IIF(something,choice1,choice2), etc. And I can't enter "select" in this expression. Because this expression will be used in the auto report generator with a SELECT statement. And as I found out, somehow the SELECT used by SFReports does not like the IIF() expression as even if I hard-code number 1 as a return choice from IIF(), the report shows a bunch of asterisks.

Thank you for your suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform