the statement below does not sum in the else part of the case statement so my totals are off with only 'P' flabtypes being summed. Help!?
SELECT FEMPNO, fcearncode,
CASE WHEN Max(Ladetail.flabtype) = 'P' THEN sum(Ladetail.Fchrglab * 60)
else sum(DateDiff(ss, Ladetail.fsdatetime, Ladetail.fedatetime))
END AS LABSeconds
FROM ladetail
Where LADETAIL.FDATE >= { d '2003-05-12' } and LADETAIL.FDATE <= { d '2003-05-18' }
group by fempno, fcearncode
order by fempno, fcearncode
SELECT FEMPNO, fcearncode,
CASE WHEN Max(Ladetail.flabtype) = 'P' THEN sum(Ladetail.Fchrglab * 60)
else sum(DateDiff(ss, Ladetail.fsdatetime, Ladetail.fedatetime))
END AS LABSeconds
FROM ladetail
Where LADETAIL.FDATE >= { d '2003-05-12' } and LADETAIL.FDATE <= { d '2003-05-18' }
group by fempno, fcearncode
order by fempno, fcearncode