Hi Again,
I am trying to get a new trx no from a database table each time a new transaction group is started but i am not getting anywhere. My code is as follows
Reader.New1
Command.CommandText = "SELECT DISTINCT TrxNo FROM Sales ORDER BY TrxNo"
Reader.Value = Command.ExecuteReader
Reader.ReadNextRow
TrxNo=Reader.GetValue(0)+1
Reader.Close
Each time i call this i expect the TrxNo to be incremented by 1 but it is not. Should the database table be refreshed each time or am i missing something else
I have tried using ASC and DESC at the end of the select statement but it does not work.
All help much appreciated
Joe
I am trying to get a new trx no from a database table each time a new transaction group is started but i am not getting anywhere. My code is as follows
Reader.New1
Command.CommandText = "SELECT DISTINCT TrxNo FROM Sales ORDER BY TrxNo"
Reader.Value = Command.ExecuteReader
Reader.ReadNextRow
TrxNo=Reader.GetValue(0)+1
Reader.Close
Each time i call this i expect the TrxNo to be incremented by 1 but it is not. Should the database table be refreshed each time or am i missing something else
I have tried using ASC and DESC at the end of the select statement but it does not work.
All help much appreciated
Joe