0

Form with info of current record + 2 before + 2 after

Let's say I have records of sessions of a club. I want create a form where I have the information in the current record ( a date, fro example) but I also want to display the date of the two previous sessions and the date of the forthcoming two session. It should display someting like

Captura de ecrã 2020-09-11, às 12.46.57

1 reply

null
    • Alain_Fontaine
    • 4 yrs ago
    • Reported - view

    You don't say a lot about the structure of your database. So let's suppose that the records are in a table called "Table1", and that the field containing the date is called, well, "Date".

    Add a layout element "View", and in its formula field, put the script:

    let d := ((select Table1) order by Date);
    let i := 0;
    while item(d, i) != Id do
    i := i + 1
    end
    ;
    slice(d, max(0, i - 2), i + 3)

    Warnings: this will not give the horizontal presentation you gave in your drawing. And I don't know how it would fare with a large data set.