Cathern Hotard170D
New Member
"I need to create a field that will show the number of days between a date and the present.\[code\]TABLE: reg_add+------------+---------+| Name | Type |+------------+---------+ | hm_date | date |+------------+---------+ | total_days | date |+------------+---------+ \[/code\]My client will type in the following date for example in "hm_date": May 1, 2012.I need "total_days" to show the total days between May 1, 2012 at the current date.I want to achieve this on server-side, which is somewhat new to me.I need to create a TRIGGER to always have "total_days" updatedI started with this and I'm having trouble making a trigger and getting it correct:\[code\]SELECT DATEDIFF(curdate(),hm_date) as total_days FROM reg_add\[/code\]Any help would be appreciated.Erik