Bernie,

Did you try taking the =s out.

sel PaymentDate,sum(PaymentAmt-DiscountAmt) from Payments group by 
PaymentDate   where PaymentDate between 3/1/2008 and
3/31/2008

John

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Bernard Lis
Sent: Saturday, June 21, 2008 7:46 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - select group by problem

This command doubles the first date amount, the rest of the days are 
correct.
Can any eyes see what is wrong?

sel PaymentDate,sum(PaymentAmt-DiscountAmt)=s from Payments group by 
PaymentDate   where PaymentDate between 3/1/2008 and
3/31/2008

PaymentDat sum (PaymentAmt
 ---------- --------------- 
 03/03/2008       56,645.00
 03/05/2008       29,046.89
 03/07/2008       32,843.24
 03/10/2008       18,010.48
 03/12/2008       36,458.73
 03/14/2008       31,927.09
 03/17/2008       19,264.68
 03/19/2008       15,948.10
 03/21/2008       48,395.80
 03/25/2008       16,198.45
 03/27/2008       15,478.12
 03/28/2008       23,689.59
 03/31/2008       29,436.23
 ---------- --------------- 
                 373,342.40

sel sum(paymentamt - discountamt) from payments where paymentdate = 3/3/2008
 sum (paymentamt
 --------------- 
       28,322.50

sel sum(paymentamt - discountamt) from payments where paymentdate = 3/5/2008
 sum (paymentamt
 --------------- 
       29,046.89

sel sum(paymentamt - discountamt) from payments where paymentdate = 3/7/2008
 sum (paymentamt
 --------------- 
       32,843.24

Bernie Lis 


Reply via email to