You are viewing limited content. For full access, please sign in.

Question

Question

Date Difference

asked on May 11, 2016 Show version history

Hi,

I have a Scenario:

Field 1: Date (Type: Date)

Field 2: Due Date (Type: Date)

Field 3: Days (Type: Dropdown)

Field 1 user gives a date, Field 3 he decides no. of days & based on it should be the value in Field 3.

So

Field 1 is 11.05.2016

Field 3 is 30

Field should be 11.06.2016

I would prefer this to be done on Forms & not on Workflow....

 

Another issue I am having is, that when I pull the value of Date fields in Update Word Document it puts the value with Time, so how would it be easiest to put the value in a hidden field without time with format 11.05.2016 ?

I'm using Forms 10.1

Thanks a lot in advance!

S

0 0

Answer

SELECTED ANSWER
replied on May 11, 2016 Show version history

Formulas are available in the field's advanced properties for this calculation. Variable names in bold below. The year and date will be the current month specified in the first date. The day is calculated by adding the number of days specified to the current day. If the number of days exceeds the number of days in the current month, the date value automatically rolls over its month and year values to account for it.

 

=DATE(YEAR(Date),MONTH(Date),DAY(Date)+Days)

Edit: For the Workflow question, you can use date formatting to remove the time component.

1 0
replied on May 11, 2016

Awesome Miruna!!!

Last piece, how do I omit Time when I save the value to update Word Document?

 

Thanks a lot!!!

0 0
replied on May 11, 2016

See date formatting above.

0 0
replied on May 11, 2016

Sorry, but I can't get my head around this....on how to format in Token? Can you please explain...

I have the field in Table, so whenever I add the Row, it makes the date with time.

 

0 0
replied on May 11, 2016

Oh, you're using a table. That's not possible. Have you tried a hidden text field in Forms with the same value as the calculated field above?

0 0
replied on May 11, 2016

The calculated Field it's fine, as it's not in table.

The problem is I have a table which is then going in word & the date Field always gives time...

0 0
replied on May 11, 2016

So if I use a table, I can't get rid of time from date Field??? 

0 0
replied on May 11, 2016 Show version history

At this time, token formatting is only available in "find and replace" and "simple merge" options in the Update Word Document activity. However, Microsoft Word offers formatting options for mail merge fields. You can right-click your merge field in the Word template, choose "Toggle Field Codes" from the context menu (which would turn your field from looking like «DateTest» into something looking like  { MERGEFIELD DateTest \* MERGEFORMAT }). You can then add the date field code formatting you want as per Word documentation{ MERGEFIELD DateTest MERGEFORMAT @\"dd.MM.yyyy"}. You can toggle off field codes, save the document and use it in the Workflow activity. Word will format the data inserted by Workflow to the specified format.                                         

0 0
replied on May 12, 2016

Miruna,

When I put the same date field out of Table it works fine even without Formatting, however inside the Table formatting doesn't work?

What should I do?

0 0
replied on May 12, 2016

Any suggestions?

0 0
replied on May 12, 2016

It works for me. I can't help you if you're not giving me any details about your configuration. Did you make sure to replace the Word document attachment on the server after editing it?

0 0
replied on May 12, 2016

I'm sorry , didn't mean to hid information, but I tried it with Presales today in Webinar & they couldn't also make it work?

Yes, I did replace the server attachment with the updated version...

The issue is only in the field in Table...

0 0

Replies

replied on May 11, 2016

For this to work you could use javascript with some Date calculator api to calculate updated date. like

http://www.timeanddate.com/services/api/

then update field 2 with that value. 

for your second question you could use regular expression to parse only date. 

0 0
replied on May 11, 2016

Thanks Junaid,

Is there any ways to do without API?

0 0
replied on May 12, 2016

This is what my table looks like. Notice the table name and the TableStart and TableEnd elements and that the fields are marked as being part of "MyTable":

0 0
replied on May 12, 2016

Please see attached file, I have same....

InteriorNew.docx (21.12 KB)
0 0
replied on May 12, 2016

 have the date in TableStart section...

0 0
replied on May 12, 2016

Your date is not formatted in the table.

0 0
replied on May 12, 2016

I must have deleted by mistake, but believe me i have tried & it doesn't work....

If it's not too much to ask can you please try it on your side on this document.....?

0 0
replied on May 12, 2016

Or just put it here

0 0
replied on May 12, 2016

Any luck?

0 0
replied on May 13, 2016

Your document worked for me as expected. The date in the table is not formatted, so I got this:

Then I formatted as explained above: { MERGEFIELD  Date  \@"dd.MM.yyyy" MERGEFORMAT }

 

 

0 0
replied on May 16, 2016

Miruna,

Thank you so Very Much!!!

It works!!!

I'm so sorry, but trust me I did everything, however this time it worked!

 

Regards,

Sahil

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.