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

2006-09-20 Thread Aaron Bono
On 9/18/06, Becky Hoff <[EMAIL PROTECTED]> wrote: The sum(dr.loan_starting_balance + dr.loan_net_change) part of the calculation have a single date, the last day in a date range chosen by the user   Sum(ds.pulled_loan_total) and sum(ds.renew_loan_amount) both have a range of dates

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] 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

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

2006-09-16 Thread Becky Hoff
I hope I can explain this clearly.  I have two queries I’m running in a report.   The first one is:   select   dr.store_id,     store.suffix,     store.sort_id,