Hi Again,
I have this function that works great (if my memory serves me correctly, thanks to Jim Chapman)
function RecurDate as D(BgnDate as D,Interval as N,RefDate as D)
RecurDate = IF(Interval<2.or.RefDate<BgnDate,{},IF(BgnDate=RefDate,RefDate,RefDate+(Mod((RefDate-BgnDate),Interval))))
end function
I use it to test if a Med needs administering on this date. For example
BgnDate = Start Date
Interval = 2 (every other day)
RefDate = Reference date, a variable I supply.
I use it in this Expression,
IF(DTOC(RecurDate(Med->Date_Ordered,Med->Recur,var->v_BeginDate+6))=DTOC(var->v_BeginDate+6),"","X")
I need a new function to allow another input for "Days as N"
Function RecurDays
BgnDate = Start Date
Interval = 2 (every other day)
Days as N
RefDate = Reference date, a variable I supply.
RecurDays = ...???
For example, if I begin a Med on April 1st, to repeat every 24 days (Interval=24), and continue for the next 7 Days,
what seven dates in June would include this activity? Would RefDate = 6/1/2013 include the Med?
I need this expression,
IF(DTOC(RecurDays(Med->Date_Ordered,Med->Recur,var->v_BeginDate+6))=DTOC(var->v_BeginDate+6),"","X")
to be true when the RefDate is any of the seven days.
Confusing... I'm sure confused, and losing sleep!!
Thanks ~ Tom
I have this function that works great (if my memory serves me correctly, thanks to Jim Chapman)
function RecurDate as D(BgnDate as D,Interval as N,RefDate as D)
RecurDate = IF(Interval<2.or.RefDate<BgnDate,{},IF(BgnDate=RefDate,RefDate,RefDate+(Mod((RefDate-BgnDate),Interval))))
end function
I use it to test if a Med needs administering on this date. For example
BgnDate = Start Date
Interval = 2 (every other day)
RefDate = Reference date, a variable I supply.
I use it in this Expression,
IF(DTOC(RecurDate(Med->Date_Ordered,Med->Recur,var->v_BeginDate+6))=DTOC(var->v_BeginDate+6),"","X")
I need a new function to allow another input for "Days as N"
Function RecurDays
BgnDate = Start Date
Interval = 2 (every other day)
Days as N
RefDate = Reference date, a variable I supply.
RecurDays = ...???
For example, if I begin a Med on April 1st, to repeat every 24 days (Interval=24), and continue for the next 7 Days,
what seven dates in June would include this activity? Would RefDate = 6/1/2013 include the Med?
I need this expression,
IF(DTOC(RecurDays(Med->Date_Ordered,Med->Recur,var->v_BeginDate+6))=DTOC(var->v_BeginDate+6),"","X")
to be true when the RefDate is any of the seven days.
Confusing... I'm sure confused, and losing sleep!!
Thanks ~ Tom
Comment