***I got it to work.*** I just have a couple other questions and should be set to go. My report looks great now thanks to you.
This was the magic formula.
//{@regular}
If Sum ({@Hours}, {@WeekStartDate}, "daily")<=44 then
Sum ({@Hours}, {@WeekStartDate}, "daily") else 44
I had to get rid of "weekly" and change to "daily and add Sum.
Once I got {@regular} work {overtime} was easy to fix.
//{overtime}
If Sum ({@Hours}, {@WeekStartDate}, "daily")>44 then
Sum ({@Hours}, {@WeekStartDate}, "daily") -44
****The only other thing I want to add is an {@Holiday}****
For example the 4th of July was a Holiday so I just want the Total Hours for that day to show up as Holiday Hours for time and a half pay in it own field.
If there are two holidays in the same week or following week to add together in weekly and Biweekly Totals.
Also, how do you get the Time in Crystal to Round to the nearest 1/4 hour. Would like to see 6.50 hours and not 6.36
I have also sent all the formulas used in this Report for anyone who may be interest.
____________________________________________________________
These are the Report Fields
{Cashier.Number}
{TimeClock.TimeIn}
{TimeClock.TimeOut}
{Cashier.Name}
These are the x1
//{@Accum}
whileprintingrecords;
numbervar biwkregtot := biwkregtot + {@regular};
numbervar biwkottot := biwkottot + {@overtime};
numbervar reggrtot := reggrtot + {@regular};
numbervar otgrtot := otgrtot + {@overtime};
//{@DateIn}
DTSToDate ({TimeClock.TimeIn})
//{@DateOut}
DTSToDate ({TimeClock.TimeOut})
//{@displbiwkottot}
whileprintingrecords;
numbervar biwkottot;
//{@displbiwkreg}
whileprintingrecords;
numbervar biwkregtot;
//{@displotgrtot}
whileprintingrecords;
numbervar otgrtot
//displreggrtot}
whileprintingrecords;
numbervar reggrtot;
//HeadingWeek}
"Week ending " + ToText({@WeekEndDate})
//{@HeadingSun}
DateVar ThisDate := {@DateIn} + 1 - DayOfWeek ({@DateIn});
"Sun " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HeadingMon}
DateVar ThisDate := {@DateIn} + 2 - DayOfWeek ({@DateIn});
"Mon " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HeadingTue}
DateVar ThisDate := {@DateIn} + 3 - DayOfWeek ({@DateIn});
"Tue " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HeadingWed}
DateVar ThisDate := {@DateIn} + 4 - DayOfWeek ({@DateIn});
"Wed " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HeadingThu}
DateVar ThisDate := {@DateIn} + 5 - DayOfWeek ({@DateIn});
"Thu " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HeadingFri}
DateVar ThisDate := {@DateIn} + 6 - DayOfWeek ({@DateIn});
"Fri " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HeadingSat}
DateVar ThisDate := {@DateIn} + 7 - DayOfWeek ({@DateIn});
"Sat " + ToText(Month(ThisDate), 0) +"/" + ToText(Day(ThisDate), 0)
//{@HoursSun}
IF DayOfWeek ({@DateIn}) = 1 THEN
{@Hours}
ELSE
0
//{@HoursMon}
IF DayOfWeek ({@DateIn}) = 2 THEN
{@Hours}
ELSE
0
//{@HoursTue}
IF DayOfWeek ({@DateIn}) = 3 THEN
{@Hours}
ELSE
0
//{@HoursWed}
IF DayOfWeek ({@DateIn}) = 4 THEN
{@Hours}
ELSE
0
//{@HoursThu}
IF DayOfWeek ({@DateIn}) = 5 THEN
{@Hours}
ELSE
0
//{@HoursFri}
IF DayOfWeek ({@DateIn}) = 6 THEN
{@Hours}
ELSE
0
//{@HoursSat}
IF DayOfWeek ({@DateIn}) = 1 THEN
{@Hours}
ELSE
0
//{@Hours}
IF IsNull({TimeClock.TimeIn}) OR IsNull({TimeClock.TimeOut}) THEN
0
ELSE
(DTSToSeconds ({TimeClock.TimeOut}) - DTSToSeconds ({TimeClock.TimeIn})) / 3600.0 + ({@DateOut} - {@DateIn}) * 24
//{@overtime}
If Sum ({@Hours}, {@WeekStartDate}, "daily")>44 then
Sum ({@Hours}, {@WeekStartDate}, "daily") -44
//{@regular)
If Sum ({@Hours}, {@WeekStartDate}, "daily")<=44 then
Sum ({@Hours}, {@WeekStartDate}, "daily") else 44
//{@Reset}
whileprintingrecords;
numbervar biwkregtot := 0;
numbervar biwkottot := 0;
//{@SelectionCriteria}
"Week Starting Date Equal (=) July 4, 2004 OR
//{@SortOrder}
"1. Cashier Name 2. Week Starting Date"
//{@TimeIn}
DTSToTimeString ({TimeClock.TimeIn})[1 to Length(DTSToTimeString ({TimeClock.TimeIn})) - 3]
//{@TimeOut}
DTSToTimeString ({TimeClock.TimeOut})[1 to Length(DTSToTimeString ({TimeClock.Timeout})) - 3]
//{@WeekEndDate}
{@DateIn} + 7 - DayOfWeek ({@DateIn})
//{@WeekStartDate}
{@DateIn} + 1 - DayOfWeek ({@DateIn})
____________________________________________________________
Group #1
GroupName ({Cashier.Name}
____________________________________________________________
Group #2
GroupName ({@WeekStartDate}, "daily")
____________________________________________________________
Group #3
GroupName ({Cashier.Name})
____________________________________________________________
Report Area: Sum of Hours
Sum ({@Hours})
____________________________________________________________
Group #1: Cashier.Name () – A:Sum of Hours
Sum ({@Hours}, {Cashier.Name})
____________________________________________________________
Group #2: WeekStartDate () –A: Sum of HoursSun
Sum ({@HoursSun}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of HoursMon
Sum ({@HoursMon}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of HoursTue
Sum ({@HoursTue}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of HoursWed
Sum ({@HoursWed}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of HoursThu
Sum ({@HoursThu}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of HoursFri
Sum ({@HoursFri}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of HoursSat
Sum ({@HoursSat}, {@WeekStartDate}, "daily")
Group #2: WeekStartDate () –A: Sum of Hours
Sum ({@Hours}, {@WeekStartDate}, "daily")