List:General Discussion« Previous MessageNext Message »
From:John Meyer Date:December 27 2005 10:10pm
Subject:Re: Need Help Writing a Trigger
View as plain text  
On Tuesday 27 December 2005 2:34 pm, Jesse wrote:
> I'm trying to write a trigger that will update the age of a camper when
> ever a record is updated or inserted.  I have a table named Campers which
> contains basic information about the camper as well as their birthday.  I
> have another table named Config which holds various settings, including the
> date at which camp begins.  The Age field in the Campers table needs to be
> set based on the Config.CampStartDate.  So, I have the following query that
> does what I need:
>

It seems to me that you're storing redundant data.  If you know their 
birthday, than you know their age, just subtract the birthday from today's 
date and you have it.

-- 
Dr. Joseph Dolan: Isn't there a children's book about an elephant named Babar? 
Fletch: I don't know. I don't have any. 
Dr. Joseph Dolan: No children? 
Fletch: No, elephant books.
Thread
Need Help Writing a TriggerJesse27 Dec
  • Re: Need Help Writing a TriggerJohn Meyer27 Dec
  • Re: Need Help Writing a TriggerJesse28 Dec
    • Re: Need Help Writing a TriggerPeter Brawley28 Dec
  • Re: Need Help Writing a TriggerJesse28 Dec
    • Re: Need Help Writing a TriggerPeter Brawley28 Dec
  • Re: Need Help Writing a TriggerJesse28 Dec