Update several records

Just on updating records, I was looking at some more advanced (For me anyway) stuff for SQL recently and solved a potential problem rather nicely by using a trigger of all things. The table has 2 dates in it amongst other things, and the interface was going to accept input of both dates which are always a set distance apart, and therefore relied on the user to do the calculation and get it right.

In the end i put a trigger on the table so that when the first date only is saved, it automatically adds the correctly calculated second date. It works perfectly and didnt take long to work out the code for the trigger too.

Much easier to just ask the user for a single date and then do the calculation seemlessly behind the scenes.

It is my first ever trigger, and Im beginning to see just how flexible they can actually be.

:slight_smile: