using 3/1/19 as beginadmitdate and 3/31/19 as Endadmitdate
all the instances work when dates are outside of those ranges except the last array.
It gives me the total number of days in a field if ex: 2/19/19 to 4/15/19 is the dates in the fields themselves which is 56.
What am I missing in this last part of the array?
if isnull ({history_bed_assignment.end_date_of_bed_assignment}) or
{history_bed_assignment.end_date_of_bed_assignment}>{?EndAdmitDate}and
{history_bed_assignment.date_of_bed_assignment}>={?BeginAdmitDate} then
Datediff("D",{history_bed_assignment.date_of_bed_assignment},{?EndAdmitDate}+1)
else
if ({history_bed_assignment.date_of_bed_assignment})<{?BeginAdmitDate} and
{history_bed_assignment.end_date_of_bed_assignment} in {?BeginAdmitDate} to {?EndAdmitDate} then
Datediff("D",{?BeginAdmitDate},{history_bed_assignment.end_date_of_bed_assignment}+1)
else
if ({history_bed_assignment.date_of_bed_assignment})<={?EndAdmitDate} and
{history_bed_assignment.end_date_of_bed_assignment}>={?BeginAdmitDate} then
Datediff("D",{history_bed_assignment.date_of_bed_assignment},{history_bed_assignment.end_date_of_bed_assignment}+1)
else
if {history_bed_assignment.date_of_bed_assignment}<{?BeginAdmitDate}and
isnull ({history_bed_assignment.end_date_of_bed_assignment} )or
{history_bed_assignment.end_date_of_bed_assignment} > {?EndAdmitDate}
then
Datediff("D",{?BeginAdmitDate},{?EndAdmitDate}+1)
all the instances work when dates are outside of those ranges except the last array.
It gives me the total number of days in a field if ex: 2/19/19 to 4/15/19 is the dates in the fields themselves which is 56.
What am I missing in this last part of the array?
if isnull ({history_bed_assignment.end_date_of_bed_assignment}) or
{history_bed_assignment.end_date_of_bed_assignment}>{?EndAdmitDate}and
{history_bed_assignment.date_of_bed_assignment}>={?BeginAdmitDate} then
Datediff("D",{history_bed_assignment.date_of_bed_assignment},{?EndAdmitDate}+1)
else
if ({history_bed_assignment.date_of_bed_assignment})<{?BeginAdmitDate} and
{history_bed_assignment.end_date_of_bed_assignment} in {?BeginAdmitDate} to {?EndAdmitDate} then
Datediff("D",{?BeginAdmitDate},{history_bed_assignment.end_date_of_bed_assignment}+1)
else
if ({history_bed_assignment.date_of_bed_assignment})<={?EndAdmitDate} and
{history_bed_assignment.end_date_of_bed_assignment}>={?BeginAdmitDate} then
Datediff("D",{history_bed_assignment.date_of_bed_assignment},{history_bed_assignment.end_date_of_bed_assignment}+1)
else
if {history_bed_assignment.date_of_bed_assignment}<{?BeginAdmitDate}and
isnull ({history_bed_assignment.end_date_of_bed_assignment} )or
{history_bed_assignment.end_date_of_bed_assignment} > {?EndAdmitDate}
then
Datediff("D",{?BeginAdmitDate},{?EndAdmitDate}+1)