Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

case for how to display punchout time today() where punch out time is null or nothing??

hello everyone,

this is my crystal report query regarding above issue,

select punchin, punchout,

(case when ( (DATEPART(hh,punchout)=0) and (DATEPART(hh,punchin))=0) and ((DATEPART(ss,punchout)-DATEPART(ss,punchin)>0) or (DATEPART(mm,punchout)-DATEPART(mm,punchin)>0))  then (RegRate * cast((datediff(mi, punchin, punchout)  / 60.0) as FLOAT) + OTWage)  else ((case when (DATEPART(hh,punchout)-DATEPART(hh,punchin))=0 then 0 else

(case when (0 between DATEPART(hh,punchin) and DATEPART(hh,punchout))

and (0 = DATEPART(hh,punchin)) then 0

when (0 between DATEPART(hh,punchin) and DATEPART(hh,punchout)) then

(RegRate * cast((datediff(mi, punchin, punchout)  / 60.0) as FLOAT) + OTWage)/(DATEPART(hh,punchout)-DATEPART(hh,punchin))

else 0 end) end)) end ) as TP2,(case when (DATEPART(hh,punchout)-DATEPART(hh,punchin))=0 then 0 else 0  end) as TP1,

(case when (1 = DATEPART(hh,punchin)) then 0  ELSE 0 END)  as [1]

so please guide me for the case where i want todays() time on which  the punchout time is null.

Former Member
Not what you were looking for? View more on this topic or Ask a question