
February 1st, 2013, 01:41 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
Quote: | Originally Posted by darroite I have three columns on my table, "in", "out" and "totaltime" all of them are timestamp type. | actually, you also have another column in the table, called "id"
you should never store a value in a column like totaltime because it can easily be calculated, so you should remove the totaltime column from your table
in other words, your entire UPDATE statement is not necessary
instead, do the calculation in the SELECT statement when you retireve data for a person
as to why your calculation "doesn't work" i'm afraid i'm not familiar with the "doesn't work" error message

|