MIN in Row

Jatz_DA_WAY

Registered User.
Local time
, 18:12
Joined
Mar 22, 2006
Messages
19
Hi All,
In order to determine the minimum value for a field in a table, we can use MIN() function.
BUT, is there a way that I can find minimum value in a particular row of a table.

For Eg: I have 5 date fields in the table & for each row I want to display minimum of all these dates.

Thanks in advance,
Jatz
 
Tables are not spreadsheets. They do not have functions with fields of a row as a domain. Your table is not properly normalized. Instead of having 5 dates in the same row, the dates need to be in a separate table and there will be a separate row for each date. That way all the relational database functions will operate properly.

If you do not wish to normalize your table, you will need to write your own function, pass it all the fields, and have it return the minimum value. Non-normalized tables are a great deal of work to work with. You are far better off to fix the problem before doing further development. It will save time in the end. There are many discussions here of normalization.
 
Thanks Pat,
I used a function to get my job done. But i'll definitely learn normalization to make my software more efficient.

Regards,
Jatz
 

Users who are viewing this thread

Back
Top Bottom