Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function MIN in expression builder
Message
From
14/07/1999 18:44:53
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
13/07/1999 23:27:16
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00241097
Message ID:
00241579
Views:
13
>Hi,
>I've got Your mail, Thanks a lot.
>Here a example of my SQL command
>SELECT V_thop_b.ten_bao,;
> MIN(V_thop_b.ck_from+V_thop_b.to_dk+V_thop_b.dauky-V_thop_b.cuoiky,;
> V_thop_b.dauky,V_thop_b.cuoiky);
> FROM fabaco!v_thop V_thop_b;
> WHERE V_thop_b.ck_from >= 1;
> AND V_thop_b.to_dk >= 1;
> GROUP BY V_thop_b.ten_bao
>
>When I add expression MIN(,,) to selected field, I always get "MIN(,,)" in selected field (View designer put function MIN into "", even if I type MIN(2,1) and add to selected fields) . Can You help me. Thanks very much. Phuong

The MIN() function in SQL Select is not the same MIN() function you may encounter elsewhere in VFP. It takes only one parameter, and calculates the minimal value of that parameter per group level. It's actually an aggregate function like SUM() or AVG(). If you want a function to calculate a minimum between two or more expressions, you better select all of them in separate columns, and a spare column to keep the result. Then, USE the cursor AGAIN IN 0, and replace the spare column with (regular VFP) MIN(field1, field2, field3).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform