Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do not count the Anes Minutes criteria

Status
Not open for further replies.

lindagoodwin

IS-IT--Management
Nov 16, 2007
22
US
I'm using Crystal 8.0.1 for this report.

Information is being pulled from an Access surgery log. With the following formula we are trying to sum the total minutes for Anesthesia without showing Local, None, or IV sedation anes mins.

Not sure who wrote this formula but it does not eliminate the "Local, None, or IV sedation" minutes. Can someone tell em what's wrong with it? Thank you for any help!

if uppercase({SurgeryLog.InsCode}) = "MC INS" and uppercase({SurgeryLog.AnesthesType}) <> "LOCAL" + "NONE" + "IV SEDATION" then if DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) > DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) then ((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [4 to 5])) - (((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [4 to 5]))) else if {SurgeryLog.AnesStartTime}<>{SurgeryLog.AnesEndTime} then ((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [1 to 2]) * 60 + 1440) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [4 to 5])) - (((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [4 to 5])))
 
Hi Linda,

I would suggest changing your first line to:

Code:
if uppercase({SurgeryLog.InsCode}) = "MC INS" and  [red]not([/red]uppercase({SurgeryLog.AnesthesType})  [red]in ["LOCAL", "NONE", "IV SEDATION"])[/red] then
if DTSToTimeString(ToText({SurgeryLog.AnesEndTime}))  > DTSToTimeString(ToText({SurgeryLog.AnesStartTime}))  then ((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [4 to 5])) - (((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [4 to 5]))) else   if {SurgeryLog.AnesStartTime}<>{SurgeryLog.AnesEndTime} then ((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [1 to 2]) * 60 + 1440) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [4 to 5])) - (((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [4 to 5])))

Hope this helps,

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Thanks MCuthill, but I think there might be something else wrong in the report. I was thinking it wa the above formula. Let me explain. Along with the Anes Min formula we have a Surgery Min formula. These two formula results should not be the same, the Anesthesia min's should always be less. Surgery Minutes counts all surgeries even the "Local", None, Iv Sedation, etc. Here is the Surgery Min formula. These are coming back with the same number of minutes for each.

if uppercase({SurgeryLog.InsCode}) = "MC INS" then
if DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) > DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) then
((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [4 to 5])) -
(((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [4 to 5])))
else
if {SurgeryLog.AnesStartTime}<>{SurgeryLog.AnesEndTime} then
((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [1 to 2]) * 60 + 1440) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesEndTime})) [4 to 5])) -
(((ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.AnesStartTime})) [4 to 5])))
else
if DTSToTimeString(ToText({SurgeryLog.SurgeryEndTime})) > DTSToTimeString(ToText({SurgeryLog.SurgeryStartTime})) then
((ToNumber(DTSToTimeString(ToText({SurgeryLog.SurgeryEndTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.SurgeryEndTime})) [4 to 5])) -
(((ToNumber(DTSToTimeString(ToText({SurgeryLog.SurgeryStartTime})) [1 to 2]) * 60) + ToNumber(DTSToTimeString(ToText({SurgeryLog.SurgeryStartTime})) [4 to 5])))

Thank you again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top