0

Take Date from another Table

I need to take a Date (FechaP1) in the ACTIVIDADES Table, from the DOCUMENTOS Table belonging to DISCIPLINAS.

The Orange Date, I try with these formula but take always the same dates

first((select DOCUMENTOS where Id = 887).FechaP1)

Or that but with error

first((select DOCUMENTOS where DISCIPLINAS.disciplina Id = 887).FechaP1)

Symbol expected ")" at line 1 column 56

9 replies

null
    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    Is more complicate that I think because need the earliest date (FechaP1) for Fecha_Inicio and the latest date (FechaP5) for Fecha_Fin 😳

    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    I try this but nothing, 😴 for the Field Formula Fecha_Inicio 

    first(('1N_Documentos'.LT_Actividades.Actividad) where '1N_Documentos' FechaP1 =< 'Fecha Corte')

    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    Luckily Ninox doesn't need Code 😔is important to have programing experience to get into this. This Forum has helped me a lot If I didn't have anything.

    • Fred
    • 1 yr ago
    • Reported - view

    Looking at an old DB, I see that Actividades has a 1:M relationship to Documentos, 1 record in Actividades has many related records in Documentos. So you don't need to do a select if you only want to get data from related records. For example if you wrote:

    first(LF_Documentos.FechaP1)
    

    It will return the data from FechaP1 of the very first record that is related to the record in Actividades.

    But this only works if all related records in Documentos have the same FechaP1 date and I noticed that some don't. I don't know if that is just because this is sample data or this actually happens in your DB.

    • Rafael Sanchis
    • Rafael_Sanchis
    • 1 yr ago
    • Reported - view

    Fred

    Right, not all documents have the same Dates each Documents has its own issue dates. 

    I don't change anything in relation database I have AVTIVIDADES 1 TO Many to DOCUMENTOS but the Formula don't work in the ACTIVIDADES Table.

    But  I can ACTIVIDADES M to M to DOCUMENTS 

    For example DISCIPLINAS Equipos (Equipments) have 3 Activities, General Equipos Activities, Especifications and Requisitions and each many Documents, but all documents is on Equipos.

    The change I do is the RooUp the hours from Dompcuments to Activities to Disciplines to Project, and work good. 

    Anyway I send you the DB work

     

    Thanks again.

    • Fred
    • 1 yr ago
    • Reported - view

    I put the following in Fecha_Icicio in Actividades:

    first('1N_Documentos'.FechaP1)
    

    And it retrieves the correct date.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred 

      God, as easy than that, and I wasted all day. 😮

      Thanks again Fred 👍

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

      Fred

      Now I can have the Gantt Chart for Activities the First Date Plan (FechaP1) and the last Date Plan ( FechaP5). Great Fred 👍

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 yr ago
      • Reported - view

       Fred

      For Info

      The planned dates cannot be moved once the project begins, only in case of replanting the project. Important delay, or scope changes.

      I Protect The Planned Dates from FechaP1 to FechaP5 

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 9Replies
  • 107Views
  • 2 Following