Link to home
Start Free TrialLog in
Avatar of al4629740
al4629740Flag for United States of America

asked on

calculation for opposite column

I have two columns in my SQL Express Table.  If Age column = 18 or above, then the Code column should have the number in it changed to 3.

How can I automatically make the Code column do this?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Avatar of al4629740

ASKER

Could you show me using the information I gave you?
hmmm. actually, you want to change the value to 3 only and once the value of age changes to 18 or higher?
then, you need a trigger...
does your table have a primary key?
yes it does

ID
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial