Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: sum fields between login and logout time Post Reply Post New Topic
Author Message
chester
Newbie
Newbie
Avatar

Joined: 10 Jun 2013
Location: Philippines
Online Status: Offline
Posts: 2
Quote chester Replybullet Topic: sum fields between login and logout time
     Posted: 12 Jun 2013 at 3:57pm
is this the right formula for getting the sum of records between the loggedin time and loggedout time??

if {loghistory.username}='ches' and
{loghistory.loggedin}<=datetimevalue(CurrentDate,Time (05,59 ,59 )) and
{loghistory.loggedout}<=datetimevalue(CurrentDate,Time (13,59 ,59 )) and
{actualguesting.paymentmode}='CASH' then
sum({actualguesting.totalamount}) else 0
IP IP Logged
praveeng
Senior Member
Senior Member
Avatar

Joined: 11 Jul 2011
Online Status: Offline
Posts: 165
Quote praveeng Replybullet Posted: 14 Jun 2013 at 12:27am
Hi Chester,
 
modify Log out formula as below,
 
if {loghistory.username}='ches' and
{loghistory.loggedin}<=datetimevalue(CurrentDate,Time (05,59 ,59 )) and
{loghistory.loggedout}>=datetimevalue(CurrentDate,Time (13,59 ,59 )) and
{actualguesting.paymentmode}='CASH' then 
1
 else
 0
 
Place the above formula in Details section and hide it..
Right click on the Formula field and select Insert > SUmmary.
 
If you use Sum(totamout) field in If condition, then it will shows sum of all the records.
 
P.S: Do you need the exact Log in time <= 05:59 and Log out >= 13:59?
or if the employee works 8 hours per a day(any time log in and any time log out because if a user login befor 05:59(Ex: 4AM log in) and logs out before 13:59(12PM Logout) in this case employee total working hours are 8 but his records doesnot count?
 
 
Praveen Guntuka,
praveen_guntuka@yahoo.com
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum