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!

Datediff with separate fields for date and time

Status
Not open for further replies.

lindagoodwin

IS-IT--Management
Nov 16, 2007
22
US
I am using Crystal Reports 10.0.
I'm pulling the tables from a SQL Connect datebase.
The patient is in Observation and need to calculate the amount of hours from start date and time thru end date and time.

{OBSERVATION.OBV_START_DATE}
{OBSERVATION.OBV_START_TIME}

{OBSERVATION.OBV_END_DATE}
{OBSERVATION.OBV_END_TIME}

I am a fairly new user to Crystal and am afraid this will be a complicated formula.

That's for all your help in advance.

 
Try:

datediff("s",datetime({OBSERVATION.OBV_START_DATE},{OBSERVATION.OBV_START_TIME}),
datetime({OBSERVATION.OBV_END_DATE},{OBSERVATION.OBV_END_TIME}))/3600

This will return hours with decimals. Not sure what you wanted the end result to be.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top