Date format issue - InfoPath Dev
in

InfoPath Dev

Date format issue

Last post 04-21-2013 11:52 AM by skybluebaz. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-20-2013 11:22 AM

    Date format issue

    Hi I am wrting a Training booking system(following the steps in the book Sharepoint 2010 creating and implementing real world projects).
    All is ok apart from one thing. The systrem has a SP list that has start & end columns that are date/time columns. If i enter a new course directly into the list, then it shows the start date in the format as expected. The Form that i am then trying to create uses this field via a data connection so that i can filter the courses using a rule for example 'start < now()' to show/hide course that are from the past.
    No mater what i try i cannot get this to work. As a further test i have also added a calculated field control to the form, this control looking at the field in the sharepoint list, but the output of that comes back in the wrong format. I m guessing that this is the reason why my filter doesnt work, but i cant work out why.

    Any ideas are really appreciated as this is driving me mad.
  • 04-21-2013 09:20 AM In reply to

    InfoPath dates are formatted differently from SharePoint column dates, and now() returns a date and a time, not just a date.

    The format you should be using is 2013-04-21T09:19:30 where the date is before the T and the time is after.

    This will allow you to use the string functions to compare whether one date is greater than another.

    Please verify the format for your SharePoint column. Just drag and drop the field into your view and see what it shows. If it isn't in the above format, you'll have to convert it using concat and substring functions.

    Patrick Halstead
    Project Manager at Qdabra
  • 04-21-2013 11:52 AM In reply to

    Hi Patrick, thanks for the reply. i dont quite follow you though(i am fairly new to infopath).The example that i am following creates a sharepoint form library with the form in it.This form has a number of sections that have various bits of text in them.  2 of the sections refer to dates. I then have some formatting rules that should show/hide the relevent section depending on the values captured. For example 1 of the rules is Training courses(secondary): Start > now(). Where training courses is the list & start is the column. So if the course is in the future this section should be hidden in my form. No matter what i try though, these section are not hidden as the rules state. I have looked at the properties of the start field from the sharepoint list within infopath & it states the datatype as dateonlytype, is this correct as in the list it is time & date.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.