I have a problem that I can’t solve:
In the database I have two tables, one to list “travel” and the other to list “tickets”
I have generate a table on a PHP page that through a query lists all the available travel (IDtravel) with all the fields, including a numerical field of the available places
In the Tickets Table (IDticket) there are all data including the number of seats booked (for each travel)
I would like to insert a column in the table with the data of the booked places relating to the IDtravel record, taking from the Tickets table by adding the result (SUM)
I tried to configure various query solutions, but it doesn’t work
I don’t know if I explained enough, but if someone has any ideas, thank you in advance
Anyone know how to do it?
In practice I have reached the point that I have a table on the page that lists (repeat) all the “ID” records
Then I also have a Connect Server connected to another database table, which through a query sums all the numerical values of the places booked, with a GET “ID” parameter
The current result of all places booked gives a correct number, and if I manually enter a value of a “ID” record it effectively filters the total
What I can’t do is being able to add a column in the table (repeat) where to insert the “places booked” data by filtering it with the ID table value
to see how to filter the second table using a value from the first one. In the second table query builder you can use the aggregate functions to return SUM:
I will follow the instructions
However, I hope to achieve this result, where the last column reports the sum of a field of a second query, filtered for the value of the first column ID (main query)
Also because that value will then serve to set up some operations with other records of the record line
Sorry marzio but that has nothing to do with what i posted above. The tutorial i sent you shows how to nest a query and filter it with the result of another one.
Your screenshots show something totally different. Just follow the tutorial i linked to and adjust it per your requirements for summing the values …
Sorry Teodor
but i got lost
I ran following the tutorial, but when I got to this point I don’t find it. It doesn’t appear to me like in the instructions
I don’t understand what exactly you’re doing from your screenshot.
Just follow the tutorial i sent you, there’s nothing more required and there’s nothing more i can explain you than what’s already explained there…