Format the Date Field of a Repeating Section bound to a secondary data source - InfoPath Dev
in

InfoPath Dev

Format the Date Field of a Repeating Section bound to a secondary data source

Last post 11-14-2011 11:44 AM by Scott Rooke. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 11-14-2011 09:44 AM

    Format the Date Field of a Repeating Section bound to a secondary data source

    I'm trying to format the date field of a secondary data source in repeating section.  When I select the properties for the field the "format" button is disabled.  The date field in the data source is from a form libary in which the date field on the submitting form is formatted to only show the date, not the time.  What shows up in my repeating section is the way SharePoint formats date fields. 2011-11-14 11:36:54 - What I want is 11/14/11. 

     How do I get change the format? 

    Thanks!

    Scott

  • 11-14-2011 09:57 AM In reply to

    Re: Format the Date Field of a Repeating Section bound to a secondary data source

    Is the control a text control? If you change it to a calculated value, in the calculated value properties, under "Result" on the General tab, you can choose how to format - you may want to try that, and change it to "Date", and try a different format.

    Hilary Stoupa

  • 11-14-2011 10:15 AM In reply to

    Re: Format the Date Field of a Repeating Section bound to a secondary data source

    Thank you Hilary for the quick response but unfortunately that did not work.  It is text control and I did change it to a "Calculated Value" and set the Format of the field to Date ony as well as Date & Time and selected to only display the Date not the Time.  And yet, no love from InfoPath. :-(

    Thoughts?

    Scott

  • 11-14-2011 10:30 AM In reply to

    Re: Format the Date Field of a Repeating Section bound to a secondary data source

    Oh, that's too bad, I was hoping that would work. You'll just have to use substring functions in that calculated value to parse the date out the way you want it, I'm afraid. You can find a sample form here.

    Hilary Stoupa

  • 11-14-2011 11:44 AM In reply to

    Re: Format the Date Field of a Repeating Section bound to a secondary data source

    That worked Hilary.  Thank you!!!  I've used that formula before, it just didn't occur to me.  For those who are interested, here is the formula to format the date MM/DD/YYYY - where @StartDate is the field from my 2DS(secondary data source) that I'm trying to format.

    concat(number(substring(@Start_Date, 6, 2)), "/", number(substring(@Start_Date, 9, 2)), "/", number(substring(@Start_Date, 1, 4)))

    Thank you again!

    Scott

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