0

select and sum only if and if

1)how can i sum values in sub table that are between start date and end date in parent table?

in parent table i have name , start date , end date.

in sub table i have date , amount.

2) i a second table how can i select the record in subtable that are between the dates in table 2 and also match the name

example select ( subtable where start date =>and =<end date and parent record name is the same as name in table2).amount

?????

2 replies

null
    • Nick
    • 4 yrs ago
    • Reported - view

    Try something like this:

     

    let begD:= 'Start Date';
    let endD := 'End Date';

    let myName := Name;

    sum((select Subtable)['Start Date >= begD and 'End Date' <= endD and Name = myName].amount)

    • Ppc
    • titanium_fish
    • 4 yrs ago
    • Reported - view

    Thank you

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 1716Views