concat and substring formula - combined? - InfoPath Dev
in

InfoPath Dev

concat and substring formula - combined?

Last post 05-05-2014 12:13 PM by tjb105. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-28-2014 07:25 AM

    • tjb105
    • Not Ranked
    • Joined on 03-31-2014
    • Posts 4

    concat and substring formula - combined?

    I want to create a formula that will take the first letter of the patient last Name field and merge it with the patient’s last 4.

    Can anyone help with this?

    I'm trying to do something similar to this post http://www.infopathdev.com/forums/p/21539/97116.aspx#97116. This is the formula I am using: concat(substring(@PATIENT_LAST_NAME), 1, 1) @Last_4_of_Patient_SSN

    This is the error I receive:

    Expected value type: end-of-string

    Actual value: ..
    concat(substring(
    ../@PATIENT_LAST_NAME), 1, 1) -->..<--/@Last_4_of_Patient_SSN

  • 05-04-2014 11:02 PM In reply to

    Re: concat and substring formula - combined?

    Hi,

    I have a formula here which uses only one text field for the first and last name. If you are using a separate field, kindly replace the formula for the 2nd concat value (last name) to the proper one.

    concat(substring(field1, 1, 1), substring(field1, string-length(field1) - 3, 4))

    where substring(field1, string-length(field1) - 3, 4)) is intended for the last name.

    Please let me know if this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 05-05-2014 12:13 PM In reply to

    • tjb105
    • Not Ranked
    • Joined on 03-31-2014
    • Posts 4

    Re: concat and substring formula - combined?

    Final formula for combining concat and substring was concat(substring(@PATIENT_LAST_NAME, 1, 1), @Last_4_of_Patient_SSN)

    This allowed me to choose the first letter of the patient's last name and the last 4 of patient's SSN. 

     "@Last_4_of_Patient_SSN" is a data field.  In other words, I did not have to use a substring to bring in the Last 4 of the patients SSN because the data field "@Last_4_of_Patient_SSN" only contains the last 4 of the patients SSN.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.