Hi John
The sample data you provided doesn't confirm to your description of processing. For example, line 3 fecend=30/05/2004 is current month -1 and should have daysextra=30 but it has daysextra=1. Can you clarify?
>i have an cursor with this information:
>sale fecend fectoday dayspassed daysextra
>1010 30/03/2004 01/06/2004 63 61
>1010 30/04/2004 01/06/2004 32 31
>1010 30/05/2004 01/06/2004 2 1
>1010 30/06/2004 01/06/2004 0 0
>
>I need that my program generate "daysextra" column asummed by fecend in current month generate daysextra=0, current month -1 generate daysextra=days in current month, month -2 and more generate daysextra= 30*months passed + days in current month
>I need to use a single sql
>somebody know how?
>
--sb--