Fayez,
your query omitted some requirements listed in the SQL query.
The query you edited gave me wrong results.
some part about the date in the cursor been less than the start date was exempted.
i run the one u sent and compared to the one i have in SQL but i got wrong result with in these fields,
sum(T1.[Debit]) as D_BF,sum(T1.[Credit]) as C_BF.
Please the take a look at it for me again.
REGARDS
JUSTICE