I would store 'estimatedduration' in minutes and convert to days or hours when neccessary.
>thnaks for the post sergey.
>actually i display status on front end screen.
>by the way u suggested ..
>SELECT st.assid, st.staffid,
> (SUM(DATDIFF(minute, wt.starttime,wt.stoptime) /
> MAX(st.estimatedduration)) * 100 AS status
> FROM staff st
> JOIN wortime wt ON st.assid = wt.fk_assid
> GROUP BY assid, staffid
>but i cannot use the field (estimatedduration) directly the way u did up abv
>bcoz the values will be like 1d or 6h or 30min etc.,
>seems i need to convert estimatedduration into minutes,right ??
--sb--