Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to use MAX() in a calculated field?
Message
 
 
To
25/01/2007 18:35:36
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Stonefield
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01189404
Message ID:
01189587
Views:
14
>
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform