Query Another Table and Add Data From That Table
Posted: 2015-01-01 09:06
Hey, I'm new here, and so far the application is really nice. I'm trying to learn the hooks because really without them the application is just a front end to a simple database.
I have a Bills table and a Payments table. There are multiple Payments for each Bill and each of those Payment records has a PaymentDate. What I'm trying to do is on the Bills view page, add either a totally new column, or concatenate it into another existing field in the list, the most recent payment date. So basically, for each time the main Bills view pulls a record, I want to run this other query to get the last Payment made and pull and display the date of that last payment for each Bill in the list. I'm not asking for someone to code the thing for me, but I would like to know what structure to use. Again, I just bought this thing yesterday so I don't know a lot yet, but just the general structure inside the Bills_init hooks section would be greatly appreciated. I've tried to piece together how to do this from the forums and other help on the site, but can't really put it all together in my mind how it should go.
Thanks in advance!
I have a Bills table and a Payments table. There are multiple Payments for each Bill and each of those Payment records has a PaymentDate. What I'm trying to do is on the Bills view page, add either a totally new column, or concatenate it into another existing field in the list, the most recent payment date. So basically, for each time the main Bills view pulls a record, I want to run this other query to get the last Payment made and pull and display the date of that last payment for each Bill in the list. I'm not asking for someone to code the thing for me, but I would like to know what structure to use. Again, I just bought this thing yesterday so I don't know a lot yet, but just the general structure inside the Bills_init hooks section would be greatly appreciated. I've tried to piece together how to do this from the forums and other help on the site, but can't really put it all together in my mind how it should go.
Thanks in advance!