Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: my balance at a certain date Post Reply Post New Topic
Author Message
seagull
Newbie
Newbie


Joined: 02 Aug 2009
Location: Saudi Arabia
Online Status: Offline
Posts: 7
Quote seagull Replybullet Topic: my balance at a certain date
     Posted: 21 Oct 2009 at 12:18am
hi,
 
I have a table (transactions) recording the activities done on the cash accounts like
 
account1   credit 2000 USD   at 02/04/2009
account1   debit 100  USD     at 05/06/2009
account1   credit 3000 USD   at 10/10/2009
 
and I have the information that my balance is 4900 USD recorded at other table (accounts)
 
the question that I need the balance at a certain date, for example I need the balance at 05/06/2009
 
and to do this I need to do one of tow solutions:
 
solution #1:
 
sumrize all the activities from the first record in the table for that account till I reach the reqired date
but this solution will cause  a performance issues and after a while some of the record will be removed for space issues.
 
 
 
solution # 2:
 
start from the balance recorded at the table (accounts) and go to the last record at the table (transactions) and subtract the amounts recored till I reach the rquired date
 
 
I need your help to tell me how can I do the second solution if possible.
 
thanks in advance
 
 
regards,
Thamer
 


Edited by seagull - 21 Oct 2009 at 12:37am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Oct 2009 at 7:09am
why not filter the data out that is after you specified data in the Reprot/Selection Formulas/Record...then you can just run the report, and no additional logic is needed.
 
HTH
IP IP Logged
seagull
Newbie
Newbie


Joined: 02 Aug 2009
Location: Saudi Arabia
Online Status: Offline
Posts: 7
Quote seagull Replybullet Posted: 23 Oct 2009 at 1:54am
I do not think the filtering can help, the problem is that there is no history recorded for the account balances for each date, and as I mentioned, I can not reach the result unless I go to the activities done for that account and do the summation(solution #1) or the subtraction(solution #2)
 
solution # 1 can be done easly, but it has more than one bad issues.
and after a time the DBA will remove the old records and this solution can be cone any more.
 
solution #2 is the best way to slove this, but the question is:
 
can I do it by the crystal report?
 
if yes, how?
 
 
thanks for your reply.
 
 
Regards,
 
Thamer


Edited by seagull - 23 Oct 2009 at 1:59am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 23 Oct 2009 at 6:07am
there is a history, it is the report. That you dba is destroying the history, well, that is just a bad practice.
 
you can sum the values that are after a date, and subtract them from a balance, so yes it is possible, it's exactly solution 1, but done from after the date you want.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum