In InfoPath, under Fields, Right Click on the single line of text field and choose Field Properties.
Under the Default Value section click the “fx” button beside the blank field.
To extract the day number of a date, use
number(substring(field1, 9, 2))
To extract the month number of a date, use
number(substring(field1, 6, 2))
To extract the year number of a date, use
number(substring(field1, 1, 4))
where field1 represents a date picker control or the function of today() to pull any of those from today’s date.
Leave a Reply