Date value - InfoPath Dev
in

InfoPath Dev

Date value

Last post 03-26-2014 03:22 AM by InfoAda. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-26-2014 01:52 AM

    Date value

    Hi,

    I have a date field called "Date" and another date field called "Archive".
    I would like archive to contain "21/12/Year of field date".

    So i tried many things but i still have the same problem. No matter if a use a calculated default value or a rule to update my field archive, i always have the field underline like if the value wasn't matching with the expected field type ...

    The formula is : concat("31/12/"; sous-chaîne(Date; 1; 4))
    -> displays 31/12/2014 but with the field highlight

    I tried all these combinations but none of them worked
    concat(sous-chaîne(Date; 1; 4); "-12-31")
    concat(sous-chaîne(Date; 1; 4); "-31-12")

    concat(sous-chaîne(Date; 1; 4); "/12/31")
    concat(sous-chaîne(Date; 1; 4); "/31/12")

    concat("31/12/"; sous-chaîne(Date; 1; 4))
    concat("31-12-"; sous-chaîne(Date; 1; 4))

    I don't get it...

    If i pick up the value in the picker it will display the same value but without error message !

    Any idea of what's wrong ?

    Regards  

    Filed under:
  • 03-26-2014 02:29 AM In reply to

    Hi,

    Date values are actually stored in the format YYYY-MM-DD in the XML, e.g. 2014-12-31.

     

    See attached XSN for a sample on how to achieve what you want. Notice I'm using a rule in the Date field with a condition: if Date is not blank, set Archive to concat(substring(., 1, 4), "-12-31")

    Hope it helps!

    Mel Clemente
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 03-26-2014 03:22 AM In reply to

    Hi,

    Thank you for replying, at the same time i found a solution but i guess you brought an explanation .
    So what i did was to use this formula : concat(sous-chaîne(Date; 1; 4); "-12-31T00:00:00").
    Even if i use date format it seems that adding time to the formula slved my problem.

    As you mentionned, the point is that date format has to be entered this way : YYYY-MM-DD whatever your local settings are or the format displayed by InfoPath.

    Thank you !

    Regards 

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