Hello, How can i Modified this code to reset the invoice number every time when year change, For example in year 2021 is Number last invoice number is 745 so when 2022 start i want to reset in 1 not continue in 746.
My Actual code is :
Please help to fix this because i'm new in vb.net
Thank You.
Code:con.Open() cmd = New SqlCommand("SELECT TOP 1 Inv_ID FROM InvoiceInfo ORDER BY Inv_ID DESC", con) rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection) If rdr.HasRows Then rdr.Read() value = rdr.Item("Inv_ID") End If rdr.Close() ' Increase the ID by 1 value += 1




Reply With Quote
