Hello everyone
I am creating my table cashbook (which is the part of my accounting software). in that
i already created my table as
create table cashbook(cno int primary key , voucherno int identity(1,1), date1 date , perticulars varchar(100),amount bigint , total bigint)
when we inserting values in that table all going ok
but my customer requirement is that can he insert back dated entries in that table means like that
cno | voucherno | date1| perticulars |amount |total
1|1|2015-11-02|for personal |2000|6000 <br>
2|2|2015-11-03| for office expences | 4000 | 10000 <br>
3|3|2015-11-03|for office | 2000 |8000
Now my customer requirement is that can he insert another value at voucherno 2 and date = 2015-11-03
then according to him our table will be
<pre lang="vb">cno | voucherno | date1| perticulars |amount |total
1|1|2015-11-02|for personal |2000|6000 <br>
2|2|2015-11-03| for office expences | 4000 | 10000 <br>
4|3|2015-11-02|for personal expences | 4000 | 14000
3|4|2015-11-03|for office | 2000 |16000 <br>
</pre>
like that when i insert any value it automatically add the the last amount + current amount but when we can insert back dated entry it follows same rule
now my question is how do i adjust the identity column value for last record , current record and next all record