set date field default value from three other fields? - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » set date field default value from three other fields? set date field default value from three other fields? Last post 12-09-2011 06:06 AM by Jimmy. 5 replies. Page 1 of 1 (6 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 12-07-2011 10:53 AM ehaze Joined on 12-11-2007 Posts 49 set date field default value from three other fields? Reply Contact month = 01 day = 01 year = 2012 I need to set a date field equal to the values above. When I tried a concat statement, the date field is outlined in red and says 'Only date allowed'. concat(../my:Month, "/", ../my:Day, "/", ../my:Year) 12-07-2011 11:31 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: set date field default value from three other fields? Mark as Not AnswerMark as Answer... Reply Contact Give concat(../my:Year, '-', ../my:Month, '-', ../my:Day) a try. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 12-08-2011 08:51 AM In reply to ehaze Joined on 12-11-2007 Posts 49 Re: set date field default value from three other fields? Mark as Not AnswerMark as Answer... Reply Contact same error. month is a string value (01) day is a string value (01) year is a string value (11) concat(../../../my:Month, "-", ../../../my:Day, "-", ../../../my:Year) Format of the Date field is MM/DD/YY 12-08-2011 12:26 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: set date field default value from three other fields? Mark as Not AnswerMark as Answer... Reply Contact In your first post, you said year is 2011, and in the new post you said it's 11. Is it 4 digits or 2? And your first post had ../ before the fields, but the new one has ../../../. Why the change? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 12-09-2011 05:59 AM In reply to ehaze Joined on 12-11-2007 Posts 49 Re: set date field default value from three other fields? Mark as Not AnswerMark as Answer... Reply Contact I was trying different formats to see if one worked better than the other. 12-09-2011 06:06 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: set date field default value from three other fields? Mark as Not AnswerMark as Answer... Reply Contact Well, my formula should work as long as the year is 4 digits and the month and day are 2 digits. If they're not, you'll need to add the 20 or leading 0 to sure them up. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software Page 1 of 1 (6 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Give concat(../my:Year, '-', ../my:Month, '-', ../my:Day) a try.
In your first post, you said year is 2011, and in the new post you said it's 11. Is it 4 digits or 2?
And your first post had ../ before the fields, but the new one has ../../../. Why the change?
Well, my formula should work as long as the year is 4 digits and the month and day are 2 digits. If they're not, you'll need to add the 20 or leading 0 to sure them up.