I am creating a windows application using c#.net 2010, How to reset invoice number at the beginning of the financial year using SQL server 2008
This is my query
select isnull(max(billnu),0) +1 from sales where saldate between CAST('04/01/'+ CAST(YEAR(GETDATE())as varchar) as DateTime) and CAST('03/31/'+ CAST((YEAR(GETDATE())+ 1) as varchar)as DateTime)
but the invoice number displays 1, last year I am done with more than 100 bills. Please any one solves my problems.