Subject RE: [ib-support] Help - Sum(TimeType)
Author Wilson, Fred
I haven't tried it but something here seems a little silly to me. Why would
you make the HoursWork (at unit of measurment), a TIME datatype, which is
the Time Of Day.. Make it an Integer or something more meaning full (for
math operations).. What you are asking, in the SQL, is what's the sum of
06:00 (6:00 am) + 14:00 (2:00 pm).. That doesn't make sense to me.. Isn't
what you really want the HoursWorked to be something like, say 8 (8 hours
worked) maybe one day, and say 10 (10 hours worked another day) such that
now the sum is 18 (18 hours total worked on those two days)..

Best regards,
Fred Wilson
SE, Bell & Howell
fred.wilson@...



-----Original Message-----
From: Ageu Duarte Junior [mailto:ageu@...]
Sent: Thursday, July 25, 2002 12:38 PM
To: ib-support@yahoogroups.com
Subject: [ib-support] Help - Sum(TimeType)


Hello

How can I do to solution this problem:

I have a table with three Columns: The name is EmployeeTimeWork, and the
columns are:

EmplyeeID Char(3)
DateWorked Date
HoursWorked Time

I need a statement to sum the hours worked between dates, I tried it:


SELECT SUM(HourWorked) FROM EmployeeTimeWork
WHERE EmployeeID = :ID
AND DateWorked >= :DateFirst
AND DateWorked <= :DateLast

But doesn't Work.





[Non-text portions of this message have been removed]



To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/