Ok, this is complicated - ready for a challenge? Using Crystal 8.5. I have a datetime field that I wanted to extract just the time information from, so I created a formula field called @PatOrInTime as:
Time ({caseintraop.pat_or_in_datetime})
this works just fine - displays as I want on the report
I then created a "standard" time formula field called @SchedTime as:
Time ('07:30AM')
this also works just fine and displays correctly on the report. Both are formatted to be HH:MM I want to do a time difference and display the result as a number in minutes between these two formula fields. Here's what I've tried:
if not isnull({casemain.schedcase_start_datetime}) and not isnull({caseintraop.pat_or_in_datetime}) then
Formula = ({@SchedTime}-{@PatOrInTime})
end if
if not isnull({casemain.schedcase_start_datetime}) and not isnull({caseintraop.pat_or_in_datetime}) then
Formula = ToNumber({@SchedTime}-{@PatOrInTime})
end if
You can ignore the "isnull" portions - that is just to be sure that I will return correct data. Both give results, but, as an example, gives 86,220 as a result when it should only be 3 (minutes). What am I doing wrong?
Time ({caseintraop.pat_or_in_datetime})
this works just fine - displays as I want on the report
I then created a "standard" time formula field called @SchedTime as:
Time ('07:30AM')
this also works just fine and displays correctly on the report. Both are formatted to be HH:MM I want to do a time difference and display the result as a number in minutes between these two formula fields. Here's what I've tried:
if not isnull({casemain.schedcase_start_datetime}) and not isnull({caseintraop.pat_or_in_datetime}) then
Formula = ({@SchedTime}-{@PatOrInTime})
end if
if not isnull({casemain.schedcase_start_datetime}) and not isnull({caseintraop.pat_or_in_datetime}) then
Formula = ToNumber({@SchedTime}-{@PatOrInTime})
end if
You can ignore the "isnull" portions - that is just to be sure that I will return correct data. Both give results, but, as an example, gives 86,220 as a result when it should only be 3 (minutes). What am I doing wrong?