How to get distinct counts in vb.net

Jeff Stiegler 466 Reputation points
2021-04-09T17:34:38.143+00:00

How do I get a distinct count using the code below:

  Command1.CommandText = "SELECT Count(account_no) FROM fphistory " &
                                "WHERE arr_date <= '12/31/2021'"

        Try
            Invoke(Sub() Total = Convert.ToInt32(Command1.ExecuteScalar))
        Catch SqlExceptionErr As SqlException
            MessageBox.Show(SqlExceptionErr.Message)
        End Try

Any help would be appreciated.

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,568 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful