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!

Formula for date range to check two different fields in same record

Status
Not open for further replies.

omoralez

Programmer
May 1, 2006
23
US
I need a formula for a date range to check two different fields the origianl change request actual end date and the task actual end date. I need to pull the record if either of these dates are within the range.

using record selection I've tried.

((date(prc_Rpt_DailyChangeRequest_Rita;1.Actual_End_Date})
in currentdate -5 to currentdate)
or
(date(prc_Rpt_DailyChangeRequest_Rita;1.Task_Actual_End_Date}) in currentdate -5 to currentdate))

But I am only getting the first test. If I reverse the fields then I still only get the first.

The Actual End Date is the Change end date and the Task end date is for the task, but it is part of the original record. The task is not a child record to the parent, but contained in the parent.
 
Please show a sample of how these dates display in the detail section when there is no record selection formula. I'm wondering whether one of the fields is always null if the other is populated. For example, is the change end date only populated once all tasks have an end date?

-LB
 
I think we have it figured out. As you asked I was not testing for the NULLs and creating a test case for each of the occurances.

If(not isnull({prc_Rpt_DailyChangeRequest_Rita;1.Actual_End_Date})) then
if(date({prc_Rpt_DailyChangeRequest_Rita;1.Actual_End_Date}) in {@StartDate} to {@EndDate}) then
true //first not null and in range
else
if(not isnull({prc_Rpt_DailyChangeRequest_Rita;1.Task_Actual_End_Date})) then
if (date({prc_Rpt_DailyChangeRequest_Rita;1.Task_Actual_End_Date}) in {@StartDate} to {@EndDate}) then
true //first not null and not in range, second not null and in range
else
false //first not null and not in range, second not null and not in range
else
false //first not null and not in range, second null
else
if(not isnull({prc_Rpt_DailyChangeRequest_Rita;1.Task_Actual_End_Date})) then
if (date({prc_Rpt_DailyChangeRequest_Rita;1.Task_Actual_End_Date}) in {@StartDate} to {@EndDate}) then
true //first null, second not null and in range
else
false //first null, second not null and not in range
else
false //both are null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top