iswarya chandran

iswarya chandran

  • NA
  • 67
  • 19.4k

M.S.Access

Aug 14 2013 4:25 AM
hi.. in my project i have tables like salesmaster and Balance..

suppose if the shop sells some item means it get stored in both the tables..

if the item cost 2000 and the customer pay just 1000 means...
In salesmaster table..

salesid date time custid grossamnt netamnt receivedamnt nobal balanceamount
111        --    --    1        2000              2000        1000           0        1000

(nobal =o if there is a balance amount or else it is 1)

and in the balance table

sno date custid debit credit balance salesid receiptno notes
11      --   1       1000    0                  111

like wise the balance amnt will be added in the balance table debit field..

am getting the remaining bal by a query

SELECT (sum(Balance.Debit)-sum(Balance.Credit)) AS Balance
FROM Balance
WHERE CustomerID=[ID];


now the second time when the customer pay the remaining balance it get added in the balance table as..
sno date custid debit credit balance salesid receiptno notes
11      --   1       1000    0                  111
12      --    1         0    1000      0                        30       --


now my question is.. how to get the details of the person who having balance amount to pay?? how to get the details who paid in one due?? how to write the query for that in msaccess 2007..


help me..