Crystal 8.5
I have created a timesheet that with formulas determines the dates and days for a pay period. Next, I need to pull in the scheduled times that relate to those timesheet dates.
Each individuals schedule may change at any time. If I have an individuals who's schedule changes during the pay period I need their timesheet to reflect both schedules to the appropriate dates.
For Example:
Date Day Work Schedule
4/17/06 Mon 8:45 to 1:45
4/18/06 Tue 8:45 to 1:45
4/24/06 Mon 9:00 to 2:00
4/25/06 Tue 9:00 to 2:00
The date & day is calculated based on the ?StartDate parameter.
The formula I have for pulling in the schedule is as follows:
if(({FD__FGP_ClientHours.Start_Date} in {@Day2} to {?EndDate}) or
({FD__FGP_ClientHours.Start_Date}<={@Day2} and isnull({FD__FGP_ClientHours.End_Date})) or
({FD__FGP_ClientHours.Start_Date} <= {@Day2} and {FD__FGP_ClientHours.End_Date}in {@Day2} to {?EndDate}) or
({FD__FGP_ClientHours.Start_Date}<={@Day2} and {FD__FGP_ClientHours.End_Date}>={?EndDate}))
then
(if {@DayOfWk2}="Mon" and {FD__FGP_ClientHours.Monday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Tue" and {FD__FGP_ClientHours.Tuesday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Wed" and {FD__FGP_ClientHours.Wednesday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Thu" and {FD__FGP_ClientHours.Thursday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Fri" and {FD__FGP_ClientHours.Friday} = "T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Sat" and {FD__FGP_ClientHours.Saturday} = "T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Sun" and {FD__FGP_ClientHours.Sunday} = "T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else "")
The formula is only bringing back the 9 to 2 schedule. I would appreciate assistance on getting this figured out.
Thanks!
I have created a timesheet that with formulas determines the dates and days for a pay period. Next, I need to pull in the scheduled times that relate to those timesheet dates.
Each individuals schedule may change at any time. If I have an individuals who's schedule changes during the pay period I need their timesheet to reflect both schedules to the appropriate dates.
For Example:
Date Day Work Schedule
4/17/06 Mon 8:45 to 1:45
4/18/06 Tue 8:45 to 1:45
4/24/06 Mon 9:00 to 2:00
4/25/06 Tue 9:00 to 2:00
The date & day is calculated based on the ?StartDate parameter.
The formula I have for pulling in the schedule is as follows:
if(({FD__FGP_ClientHours.Start_Date} in {@Day2} to {?EndDate}) or
({FD__FGP_ClientHours.Start_Date}<={@Day2} and isnull({FD__FGP_ClientHours.End_Date})) or
({FD__FGP_ClientHours.Start_Date} <= {@Day2} and {FD__FGP_ClientHours.End_Date}in {@Day2} to {?EndDate}) or
({FD__FGP_ClientHours.Start_Date}<={@Day2} and {FD__FGP_ClientHours.End_Date}>={?EndDate}))
then
(if {@DayOfWk2}="Mon" and {FD__FGP_ClientHours.Monday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Tue" and {FD__FGP_ClientHours.Tuesday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Wed" and {FD__FGP_ClientHours.Wednesday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Thu" and {FD__FGP_ClientHours.Thursday}="T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Fri" and {FD__FGP_ClientHours.Friday} = "T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Sat" and {FD__FGP_ClientHours.Saturday} = "T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else if {@DayOfWk2}="Sun" and {FD__FGP_ClientHours.Sunday} = "T" then
totext(time({FD__FGP_ClientHours.HoursFrom}),"h:mm")+" - "+totext(Time({FD__FGP_ClientHours.HoursTo}),"h:mm")
else "")
The formula is only bringing back the 9 to 2 schedule. I would appreciate assistance on getting this figured out.
Thanks!