Only Date or Date and Time Allowed issue in infopath 2010 forms

I have created two date fields(Date only type) field1 and field2  in sharepoint list.Field1 default value is now() and field2 value is concat(substring-before(field1, "-"), "-", substring-before(substring-after(field1, "-"), "-") + 1, "-", "10") but I am getting red box around the field2 with ""Only Date or Date and Time Allowed" message.

The same formula for field2 is working without any issues for form libraries. I am having issue only for sharepoint list forms.

Can anybody help me out to resolve this issue?

Any help would be appreciated.
aaedlaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Clay FoxDirector of Business IntegrationCommented:
I get the error on field 1, should use today() rather than now() since it is a date only.

it helps to use calculated value controls to troubleshoot the formulas since you can see the raw text of each potion.
0
aaedlaAuthor Commented:
Thank you for your help. We cannot use today function for sharepoint lists.
0
Clay FoxDirector of Business IntegrationCommented:
You need to make sure that the field in the list matches your form.

Otherwise make your field a Date/Time type.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.