Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Function MIN in expression builder
Message
From
14/07/1999 11:37:30
 
 
To
14/07/1999 11:02:22
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00241097
Message ID:
00241286
Views:
14
>Phoung-
>I don't see any obvious syntax problems (I probably am just still sleepy < s>). Have you tried pasting the command in the command window and running it? You might try simplifying it, and add pieces as you go. Also, if you want a specific column heading for calculated column (the MIN function), use the AS clause. For example: SELECT MIN(a,b,c) AS MinCalc...
>
>Once the SQL select works, you can add the CREATE SQL VIEW myView AS SELECT ... syntax to create the view in the DBC.
>
>HTH
>
>>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

Hi Nancy:

Sorry for jumping in

I think the problem is that the MIN() fiction when used in a SQL SELECT groups upon grouped results, probably to determine the minimun of three columns an IIF() function could work:

Iif(V_thop_b.ck_from+V_thop_b.to_dk+V_thop_b.dauky_thop_b.cuoiky < V_thop_b.dauky, V_thop_b.ck_from+V_thop_b.to_dk+V_thop_b.dauky_thop_b.cuoiky ,V_thop_b.cuoiky) as mimimum;

Oscar
Previous
Reply
Map
View

Click here to load this message in the networking platform