Increase/decrease date per page

Hello,

I got over 100 pages and all of them need date on top of the page.
But the date needs to increase per page. For example:

Page 1: 1.1.2015

Page 2: 2.1.2015

Page 3: 3.1.2015 and so on.

Thanks for your help

This is not possible in the header because header contents is computed only once when the page style is activated.

Apparently, your pages are dedicated to events or matters happening on said date. It is likely there is a manual page break between pages to start content at top of page.

The idea is then to use a formula to increment a “date” variable.

On the first page, make a new paragraph and Insert>Field>More Fields, Variables tab with Type Set variable. Give it name pagedate (*), value your initial date and Format one of Additional formats fit for a date and your taste.

(*) CAUTION! Don’t use “date” for the variable name; it appears somewhat reserved and will cause rejection of the formula.

On page 2, make a new paragraph and Insert>Field>More Fields, Variables tab with Type Insert Formula, Select your date variable and Formula pagedate = pagedate + 1, Format as above.

Create a specific custom-style for these paragraphs so that you can associate a “page break before” to them which will spare you the pain to insert it manually (and prevent the risk of forgetting it).

Copy the page 2 paragraph and paste it without modification at top of all your pages. Don’t forget to remove your existing manual page break if any.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

Any TextField of type Date or Time is internally based on a MasterField. You can define an offset for every DependentField independently. I would therefore suggest to insert a little TextFrame on the first (physical) page dedicated to contain a date field (and probably a page field), not inserted in a header (!!), but anchored to the page. The position and the format properties should be defined there,
You then can copy that frame and insert it on the next page and the one after…
After each insertion only the DateField needs to be selected and edited using the context menu increasing the offset (in days) by 1 per page.
The process can be automated by user code. The internal (API) name of the offset property for dependent date/time fields is .Adjust there, and the mandatory unit is the minute (1440 per day).
See ask50002incrementedDateField_0.odt for an example.

@ajlittoz, Tried it, but first field gives me “** Expression is faulty **”. Maybe I am missing tomething.

@LeroyG: thanks for notifying. I made my experiment with a random variable name and used “date” in the answer without checking. It looks like “date” is somehow reserved. Changing for another name works.