alexmshcare Posted May 24 Report Share Posted May 24 I need to combine the content of 4 fields in one field in the table. The data type is number. When one of the fields is empty, the formula does not work. Can someone help me, please? CONVERT(VARCHAR(10),[@field:AssignedAgentPrimary_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned1_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned2_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned3_STID],101) Quote Link to comment Share on other sites More sharing options...
0 Barry Posted May 24 Report Share Posted May 24 Hello Alex. Using "ISNULL" -> https://howto.caspio.com/function-reference/#:~:text=IsNull(value%2C replace_value) will work for your case as it will check if the value is null and return an empty string instead of null(which will cause the formula not to work as "null" is not a string) For your case, you can also use CAST to convert the number, like this: ISNULL(CAST([@field:AssignedAgentPrimary_STID] AS VARCHAR), '') + ',' + ISNULL(CAST([@field:AddtlAgentAssigned1_STID] AS VARCHAR), '') + ',' + ISNULL(CAST([@field:AddtlAgentAssigned2_STID] AS VARCHAR), '') + ',' + ISNULL(CAST([@field:AddtlAgentAssigned3_STID] AS VARCHAR), '') Quote Link to comment Share on other sites More sharing options...
Question
alexmshcare
I need to combine the content of 4 fields in one field in the table. The data type is number.
When one of the fields is empty, the formula does not work.
Can someone help me, please?
CONVERT(VARCHAR(10),[@field:AssignedAgentPrimary_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned1_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned2_STID],101) + ',' + CONVERT(VARCHAR(10),[@field:AddtlAgentAssigned3_STID],101)
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.