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
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,
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 ) )
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
[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
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
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