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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need formula to get date/time field in #d, #h, #m format 2

Status
Not open for further replies.

pj2256

Programmer
Oct 12, 2009
6
0
0
US
I need help with a date/time formula. I have two formulas that give me two different date and time. One date/time is when the medication was originally ordered and the second date/time is when the medication was redispensed by the pharmacy. I need to get the difference between these two dates/times in the form of days, hours, and minutes, i.e, 8d 17h 32m. Is this possible? I have tried using the DateDiff formula and it only give me hours, i.e., 143.00. This is the formula I am trying (unsuccessfully) to use:


If DateDiff("d",{@OrderDate},{@RXActionInstant})> 1
then DateDiff("d",{@OrderDate},{@RXActionInstant}) +
DateDiff ("h",{@OrderDate},{@RXActionInstant})+
DateDiff ("m",{@OrderDate},{@RXActionInstant})
else
DateDiff ("m",{@OrderDate},{@RXActionInstant})

FYI:
{@OrderDate}=
If {ZC_DISP_TYPE.DISP_TYPE_C} = 8
then
{ORDER_MED.ORDER_INST}

{@RXActionInstant}=
If {ZC_DISP_TYPE.DISP_TYPE_C} = 8
then
{ORDER_DISP_INFO.ACTION_INSTANT}


Hope you can help,
pj2256

 
Please see faq767-3543. Set dur := DateDiff("s",{@OrderDate},{@RXActionInstant}).

-LB
 
Thank you so much lbass! That worked!

pj2256
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top