Subject RE: [ib-support] Calling all SQL Gurus...
Author Bill Meaney
I agree with Martijn, best to change the table. In the meantime you could
try

and ((H.Yr * 100 + H.mo >= 200108) and (H.Yr * 100 + H.mo <= 200207))


>
> Hi Martijn,
> Yes, I've been thinking about changing the table.
>


> > SELECT
> > H.CUSTNO, H.CUSTNAME,
> > SUM ( H.SALESAMT ) AS SALESAMT, SUM ( H.GROSSMARGIN ) AS
> GROSSMARGIN
> > FROM CUST_HIST H
> > WHERE
> > H.COMPANY = '01' AND DIVISION = '01'
> > and ((H.Yr >= 2001 and H.mo >=8) and (H.Yr <= 2002 and H.mo <=7))
>