Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula Help Post Reply Post New Topic
Author Message
kaupang
Newbie
Newbie
Avatar

Joined: 14 Jul 2010
Location: United States
Online Status: Offline
Posts: 11
Quote kaupang Replybullet Topic: Formula Help
    Posted: 19 Oct 2010 at 3:45am
Hello,

I am attempting to display appointment times from 3 different tables.  Each field is minutes from midnight.  Here's the formula:

if {APPOINT.Appointment} > 0 then
( if Truncate ({APPOINT.From} / 60 )  > 12.00 then
        ToText ((Truncate ({APPOINT.From} / 60 )) - 12,"0") +":"+ToText (Remainder ({APPOINT.From},60 ),"00") + "PM"
    else if Truncate ({APPOINT.From} / 60 )  = 12.00 then
        ToText (Truncate ({APPOINT.From} / 60 ),"0") +":"+ToText (Remainder ({APPOINT.From},60 ),"00") + "PM"
    else
        ToText (Truncate ({APPOINT.From} / 60 ),"0") +":"+ToText (Remainder ({APPOINT.From},60 ),"00") + "AM"
)
else if {RESERVE.Appointment} >= 0 then
( if Truncate ({RESERVE.Start} / 60 )  > 12.00 then
        ToText ((Truncate ({RESERVE.Start} / 60 )) - 12,"0") +":"+ToText (Remainder ({RESERVE.Start},60 ),"00") + "PM"
    else if Truncate ({RESERVE.Start} / 60 )  = 12.00 then
        ToText (Truncate ({RESERVE.Start} / 60 ),"0") +":"+ToText (Remainder ({RESERVE.Start},60 ),"00") + "PM"
    else
        ToText (Truncate ({RESERVE.Start} / 60 ),"0") +":"+ToText (Remainder ({RESERVE.Start},60 ),"00") + "AM"
)
else if {VACATION.Id} >= 0 then
( if Truncate ({VACATION.StartTime} / 60 )  > 12.00 then
        ToText ((Truncate ({VACATION.StartTime} / 60 )) - 12,"00") +":"+ToText (Remainder ({VACATION.StartTime},60 ),"00") + "PM"
    else if Truncate ({VACATION.StartTime} / 60 )  = 12.00 then
        ToText (Truncate ({VACATION.StartTime} / 60 ),"00") +":"+ToText (Remainder ({VACATION.StartTime},60 ),"00") + "PM"
    else
        ToText (Truncate ({VACATION.StartTime} / 60 ),"00") +":"+ToText (Remainder ({VACATION.StartTime},60 ),"00") + "AM"
)

{APPOINT.Appointment}, {RESERVE.Appointment}, {VACATION.Id} are the unique primary keys for each table.  The problem I'm having is with the last portion, VACATION.StartTime, to display on the report.  This formula is in a subreport that is in the details section of the main report.  The report displays clinic appointments, vacations times, and blocked times for students at a dental school.  Based upon the parameter date, it should display what each student has scheduled for that day.  Right now, only APPOINT and RESERVE table data is showing up. 

I'm a newbie at this stuff, so I apologize in advance.  Please let me know if there's more required information or if screenshots are needed.

Thanks,

Kaupang
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.017 seconds.