Calculated Fields in a table

rolypoly

New member
Local time
Today, 16:16
Joined
Sep 27, 2012
Messages
7
I have three columns where A is a number, B is a number and I want to make C = to the greater of the two. i.e. Col A = 10, Col B = 12 therefore Column C = Col B or Col A = 12, Col B = 10 therefore Col C = Col A

Please help
 
Calculated fields should not be in tables.. Please do not go ahead with this design.. This will cause more trouble than you could think.. Look at Allen Browne's explanation..
 
Thank you Paul. I still need to build an expression to auto populate Col C. Can this be done?
 
In a Form or Query absolutely.. but do not store it in the table.. If you want to use it in a Form create an unbound textbox, in its Default value.. use this condition..
Code:
=IIF([ColA]>[ColB],[ColA],[ColB])
Similar in a query but you need is an Alias for the field.. somthing like..
Code:
SELECT *, bestValue: IIF([ColA]>[ColB],[ColA],[ColB]) FROM yourTable;
 
Paul you are an absolute gentleman and a scholar. Thank you very much
 

Users who are viewing this thread

Back
Top Bottom