|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
minimum value of 2 fields
i need to create a dynamic field, which returns the minimum value of 2 fields.
A B C(i need) 500 600 500 350 250 250 825 950 825 select A,B,min(A,B) as C from MyTable i know this query is wrong, pls help me to solve this problem RGDS BAHA |
|
#2
|
|||
|
|||
|
select A, B, (case when A < B then A else B end) as C from MyTable
|
|
#3
|
|||
|
|||
|
need equivalent access query
Quote:
Thanks for ur reply, i think MsAccess doesn't support this code. i don't get problem with oracle, even i can use select A,B,least(A,B) form MyTable pls help me to get the equivalent code in Access |
|
#4
|
|||
|
|||
|
select A, B, (iif(A < B, A, B)) as C from MyTable
|
|
#5
|
|||
|
|||
|
i got it
Quote:
Thank U very much |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > minimum value of 2 fields |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|