Balance Difference

Hi to all,

i need a small help. how to find the difference between Balance ondate and Balance on 90days back.

i customised two fileds in ,when am creating a new sales order -->sales order form i added 2 fields Balance on date,balance on 90days back.so know please help,when am select a customer number these 2 fields will get the values.

Finally i completed with my requirement ,i created 2 display methods in form data source.

display real BalanceOn90DaysBack()
{
CustTrans custTransBal;
date date1=systemdateget();
;
select sum(AmountMST), sum(SettleAmountMST) from custTransBal
where custTransBal.AccountNum == salesTable.CustAccount &&custTransbal.TransDate<=mkdate(dayofmth(date1),mthofyr(DATE1)-3,year(DATE1)-3);

return (custTransBal.AmountMST - custTransBal.SettleAmountMST);
}

display real BalanceOnDate()
{
CustTrans custTransBal;
;
select sum(AmountMST), sum(SettleAmountMST) from custTransBal
where custTransBal.AccountNum == salesTable.CustAccount &&custTransbal.TransDate<=systemdateget();

return (custTransBal.AmountMST - custTransBal.SettleAmountMST);
}