0

Compare fields of 2 tables to get result

Hi,

I have a "Carte-cadeaux" table in which I have the following fields:
- "Code de la carte-cadeau" in text format
- "Solde restant" in number format

From another table named "Paiements" I have a text field named "Code de la carte" in which I write down a card code myself. I also have a formula field named "Solde restant de la carte après déduction"

In this formula field, I would like to add a formula that displays the balance of the gift card as long as the fields are the same:
- "Code de la carte cadeau" (text format)
- "Code de la carte" (text format)

Can anyone tell me what formula to use to get the information from the "Solde restant" field of the "Carte-cadeaux" table?

Thanks for your help.

3 replies

null
    • Créateur de bien-être
    • Sebastien_Guillet
    • 1 yr ago
    • Reported - view

    It is possible that I have 2 records containing the same value in the "Code de la carte-cadeaux" field of the "Carte-cadeaux" table. It would be great if the formula sums the "Solde restant" fields.

    • Ninox developper
    • Jacques_TUR
    • 1 yr ago
    • Reported - view

    Try putting this code in the 'Remaining card balance' formula of the 'Payments' table.

    var t := this
    sum((select 'Carte-cadeaux' where 'Code de la carte-cadeau' = t.'Code de la carte').'Solde restant')
      • Créateur de bien-être
      • Sebastien_Guillet
      • 1 yr ago
      • Reported - view

      Jacques TUR I would not have succeeded in creating this code. I didn't have that logic. THANKS ! it works wonderfully.

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 3Replies
  • 48Views
  • 2 Following