Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 07 Sep 2017 at 7:58am
You can't really stitch them together that way.
I assume there is a hierarchy to the 5 fields, meaning that if field 1 is not empty it is the value to use, then if field 2 is not empty it is the value to use, etc.
Is this a correct assertion? If so, what is that hierarchical sequence?
Joined: 21 Aug 2017
Location: United States
Online Status: Offline
Posts: 39
Posted: 07 Sep 2017 at 8:05am
Yes you are correct. the hierarchy is:
{tbl_v2_adult_intake.assessment_date}
{tbl_adult_intake_assessment.assessment_date}
{tbl_adult_intake_assess_V2.Data_Entry_Date}
{tbl_DA_Adult_Mental_HA.Data_Entry_Date}
{tbl_DA_Mental_Health.Data_Entry_Date}
I also tried this formula and it works for the first three fields but not sure how to add in the last two.
if isnull({tbl_v2_adult_intake.assessment_date})
then
(
if isnull({tbl_adult_intake_assessment.assessment_date})
then
{tbl_adult_intake_assess_V2.Data_Entry_Date}
else
{tbl_adult_intake_assessment.assessment_date}
)
else
{tbl_v2_adult_intake.assessment_date};
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 07 Sep 2017 at 8:23am
if not isnull({tbl_v2_adult_intake.assessment_date} ) then totext({tbl_v2_adult_intake.assessment_date})
else if not isnull({tbl_adult_intake_assessment.assessment_date}) then totext({tbl_adult_intake_assessment.assessment_date})
else if not isnull({tbl_adult_intake_assess_V2.Data_Entry_Date}) then totext({tbl_adult_intake_assess_V2.Data_Entry_Date})
else if not isnull({tbl_DA_Adult_Mental_HA.Data_Entry_Date}) then totext({tbl_DA_Adult_Mental_HA.Data_Entry_Date})
else if not isnull({tbl_DA_Mental_Health.Data_Entry_Date}) then totext({tbl_DA_Mental_Health.Data_Entry_Date}) else "MHA Missing"
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 07 Sep 2017 at 8:23am
Back to the error message. You were checking the fields against a "", so I made the assumption the fields were strings. The issue you are going to have is the formula has to return a single data type. It will not return a date or a string (last if statement). My formula would work if you replaced the = '' with the isnull check (as you did in the previous post), but also for the last if statement to work where you have the phrase "MHA Missing", the result of each if statement will have to be converted to a string (i.e, CSTR or TOTEXT).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum