Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Time Calculations

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-29 : 20:58:00
Michael writes "I have a need to calculate the time in hours that a employee has worked and if it is less then 40 hrs return this info to my ASP page. I am having problems with the below statement. "Incorrect syntax near @TimeWorked"

Any Ideas? I am new to SQL 7.0.

SELECT DISTINCT
dbo.datEmployee.LastName, dbo.datEmployee.FirstName,
dbo.datLabor.WeekendingDate AS [@wkEnding],
SUM((dbo.datLabor.EndTime - dbo.datLabor.StartTime) / 60)
AS @TimeWorkded
FROM dbo.datEmployee INNER JOIN
dbo.datLabor ON
dbo.datEmployee.datEmployeeID = dbo.datLabor.datEmployeeID"
   

- Advertisement -