Re: [SQL] Dividing results from two tables with different time frames

2006-09-17 Thread Aaron Bono
On 9/15/06, Becky Hoff <[EMAIL PROTECTED]> wrote: What I'm trying to accomplish is to get two percentages.  Both have one element from one table divided by an element in the other table. sum(ds.pulled_loan_total)/sum(dr.loan_starting_balance + dr.loan_net_change)*100 as pulls_percent, and

Re: [SQL] Transactional behaviour with trigger

2006-09-17 Thread Joost Kraaijeveld
Hi Michael, Thanks for answering. On Sun, 2006-09-17 at 08:36 -0600, Michael Fuhr wrote: > On Sun, Sep 17, 2006 at 02:32:10PM +0200, Joost Kraaijeveld wrote: > Where does prototype.customers fit in? Are you sure it has a row > that matches the WHERE clause? Where would that row have come from?

Re: [SQL] Transactional behaviour with trigger

2006-09-17 Thread Michael Fuhr
On Sun, Sep 17, 2006 at 02:32:10PM +0200, Joost Kraaijeveld wrote: > For the contactaddress I also have a trigger(function) that should > update the record in the third table with the additional info of the > contactaddress: > > > SELECT INTO customer_record objectid FROM prototype.customers

[SQL] Transactional behaviour with trigger

2006-09-17 Thread Joost Kraaijeveld
Hi, I create two records in a transaction in two different tables: customer and contactaddress. customer has a foreign key to contactaddress. I also have third table, customeraddress, which is a materialized view of the join of customer and contactaddress For the table customer I have a trigger(

Re: [SQL] Dividing results from two tables with different time

2006-09-17 Thread Ragnar
On fös, 2006-09-15 at 10:34 -0500, Becky Hoff wrote: > I hope I can explain this clearly. Not clear enough for me. > I have two queries I’m running in a report. > The first one is: [snip] > No matter which query I place them in it gives me the wrong data > because of the time frames. How c