>It's easier if you were sure that there was a record for each date:
>
>SELECT
> a.item,
> a.date,
> a.value,
> b.date,
> b.value
>FROM
> thetable a
> INNER JOIN thetable b ON b.date = a.date + 1
>WHERE
> ABS((a.value / b.value) - 1) > .5
>
>-Mike
It is not sure that I have price for every day (saturdays and sundays are not there for sure).
But I haven't of JOIN. I think that I can do something like:
INNER JOIN thetable b ON b.date = (select min(date) ... where c.date > a.date )
Can this be good?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com