Re: Query skips one set of records

2007-01-21 Thread Miles Thompson
Peter (and Felix), Thank you, and I learned something today. Now I have a script that needs adjusting. The amount certainly is "indeterminate". The wonder is that we were able to run with this for so long. Regards - Miles At 03:57 PM 1/21/2007, Peter Brawley wrote: Miles Try it yourself w

Re: Query skips one set of records

2007-01-21 Thread Peter Brawley
Miles Try it yourself with table tbl (id,cost) with rows (1,10),(1,50),(2,100): SELECT id, IF( cost=10, SUM(cost*2 )+ 200, SUM(cost*12)) AS Amount FROM tbl GROUP BY id,cost; +--++ | id | Amount | +--++ |1 |320 | |2 | 1200 | +--++ SELECT id,

Re: Query skips one set of records

2007-01-21 Thread Miles Thompson
At 03:58 AM 1/19/2007, Felix Geerinckx wrote: [EMAIL PROTECTED] (Miles Thompson) wrote in news:[EMAIL PROTECTED]: > This query: > > SELECT > member_id, > member_sub_id, > IF( ( monthly_cost = 10 ), ( SUM(( monthly_cost * 2.00 ) + 200 ) > ), ( SUM( > monthly_cost * 12.00 ) )

Re: Query skips one set of records

2007-01-21 Thread Miles Thompson
At 12:14 AM 1/19/2007, Dan Nelson wrote: In the last episode (Jan 18), Miles Thompson said: > The query displayed below performs flawlessly, except for these two records: > > 7364 M0174000250510 Invoice 2006-12-13 2006-12-13 2006-12-31 > 7365 M01740 00

Re: Query skips one set of records

2007-01-19 Thread Felix Geerinckx
[EMAIL PROTECTED] (Miles Thompson) wrote in news:[EMAIL PROTECTED]: > This query: > > SELECT > member_id, > member_sub_id, > IF( ( monthly_cost = 10 ), ( SUM(( monthly_cost * 2.00 ) + 200 ) > ), ( SUM( > monthly_cost * 12.00 ) ) ) AS Amount > FROM subinfo > WHERE > MON

Re: Query skips one set of records

2007-01-18 Thread Dan Nelson
In the last episode (Jan 18), Miles Thompson said: > The query displayed below performs flawlessly, except for these two records: > > 7364 M0174000250510 Invoice 2006-12-13 2006-12-13 > 2006-12-31 > 7365 M01740 002506 5 Invoice 2006-12-13

Query skips one set of records

2007-01-18 Thread Miles Thompson
The query displayed below performs flawlessly, except for these two records: 7364M0174000250510 Invoice 2006-12-13 2006-12-13 2006-12-31 7365M01740 002506 5 Invoice 2006-12-13 2006-12-13 2006-12-31 Here's the table structure