How about this?
select fk_assid,
CASE WHEN sum(datediff(n,wt_starttime,wt_stoptime)) IS NULL THEN '0'
ELSE sum(datediff(n,wt_starttime,isnull(wt_stoptime,getdate())))
END as 'timespent',
SUM(CASE WHEN datediff(d, CONVERT(varchar(15), GetDate(), 106), CONVERT(varchar(15), wt_starttime, 106)) = 0
THEN datediff(n,wt_starttime,isnull(wt_stoptime,getdate()))
ELSE '0' END) as 'timespenttoday'
from worktime
group by fk_assid
In the second CASE I just check if todays date and the date of the start time are the same. The CONVERT statement converts the Datetime to 'dd-mmm-yyyy'
--------------------
Colt 45 - the original point and click interface 