Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use MAX() in a calculated field?
Message
 
 
À
25/01/2007 18:35:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01189404
Message ID:
01189587
Vues:
15
>
>max() and min() are always problematic in SQL - SELECT statements, because they have another meaning: the maximum value for a single field, within a set of grouped records.
>
>Replace it with an iif(), for example:
>
>
>iif(date_fld1 - date_fld2 > 0, date_fld1 - date_fld2, 0)
>
>
>... or create a UDF:
>
>
>MyMax(date_fld1 - date_fld2, 0)
>
I decided to go with your UDF suggestion. It works.

Thank you very much.
"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
Répondre
Fil
Voir

Click here to load this message in the networking platform