Formula Help: Substring/Translate - InfoPath Dev
in

InfoPath Dev

Formula Help: Substring/Translate

Last post 05-21-2009 12:33 PM by richardlpalmer. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-21-2009 10:56 AM

    Formula Help: Substring/Translate

    I have an existing form that I'm modifying due to some internal business process changes. One of the fields displays a filtered date which uses the "translate" function. It essentially displays the date minus the "T" and h:m:s after it.

    translate(@ows_NextReleaseDate[@ows_OfferingID = Offering_x0020_ID], " ", "T")

    The column that will now be providing the date is from a calculated field. This is what a date looks like: datetime;#2009-07-01 00:00:00

    What I've attempted to do is use the "substring-after" function to get rid of the "datetime:#" portion, while leaving the translate function to get an accurate date.

    substring-after(translate(@ows_NextReleaseDate[@ows_OfferingID = Offering_x0020_ID], " ", "T")),"#")

    I keep getting an error... :(

    Any help on sorting it out?

  • 05-21-2009 11:04 AM In reply to

    Re: Formula Help: Substring/Translate

    Okay, this is the 2nd thread I've started only to find my own problem. I apologize for those of you trying to help only to have me figure out my own bone-headed mistake.

    The problem with the formula is an additional end parenthesis after the "T".

    So this;

    substring-after(translate(@ows_NextReleaseDate[@ows_OfferingID = Offering_x0020_ID], " ", "T")),"#")

    Should be this;

    substring-after(translate(@ows_NextReleaseDate[@ows_OfferingID = Offering_x0020_ID], " ", "T"),"#")

    Problem solved and the date(s) are now displaying perfectly.

  • 05-21-2009 11:17 AM In reply to

    Re: Formula Help: Substring/Translate

    May I suggest a notepad replacement that has parenthetical matching? Notepad 2 (link is to zip) is a great text editor. If you copy a formula into it, and click by a parenthesis, the match highlights in red. Unmatched are highlighted in blue. It can simplify this type of issue for me, at least...

    Hilary Stoupa

  • 05-21-2009 12:33 PM In reply to

    Re: Formula Help: Substring/Translate

    That's super helpful. Thank you very much. :)

    (Looks like it doesn't install, runs as a stand alone .exe. I think I'll pin it to my Quck Launch.)

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