|
From: Bob S. <bo...@pr...> - 2000-11-13 22:22:04
|
All, I have been working on updating timetrack to use an end_time field in the job_details field, and I have developed the following sql script which can be used to update the current table to calculate the value for this field. However, I believe the last line only works in MySQL 3.23 or higher. Can anyone come up with something that will work with earlier versions? I also already have the code completed for inputing end_times with a readonly field that is updated to show hours and still stores hours in the table (I know this is a little redundant, but maybe we can change it later). But I am still working on the editdetails.php page. The following sql code assumes that the end_time field already exists: alter table job_details change end_time end_time varchar(30); update job_details set end_time = concat(floor(num_hours),":", truncate((num_hours-floor(num_hours))*60,0),":00"); alter table job_details change end_time end_time time; # The next line MAY only work in MySQL 3.23+ update job_details set end_time = start_time + end_time; -- ______________________________________________________________________ Bob Schader Computer Systems Manager Product Design International, Inc. 4880 36th St. SE, Suite 100 Grand Rapids, MI 49512 Voice: (616) 667-2600 x104 Fax: (616) 667-2692 |