Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Update Excel Spreadsheet where value is blank not working

Hi,

The code below does not work... How to I check if Payer Claim Number is blank?   It works if I add a real value but that's the problem i'm facing.

Thanks
~j

        Dim path = "C:\Users\A303375\cc\ICD10\files\Sample Alternative Approach ICD10 Claims Data_UW_BACKUP.xlsx" '"c:\users\a303375\Desktop\Book1.xlsx"
        Dim connStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;"
        Try
            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim myCommand As New System.Data.OleDb.OleDbCommand
            Dim sql As String

            MyConnection = New System.Data.OleDb.OleDbConnection(connStr)
            MyConnection.Open()
            myCommand.Connection = MyConnection
            'sql = "Update [Sheet1$] set [C3] = 'New Name' where id=1"
            sql = "Update [ICD10 Data$] set [Result] = 'Incomplete' WHERE [Payer Claim Number]=''"

            myCommand.CommandText = sql
            myCommand.ExecuteNonQuery()
            MyConnection.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

Open in new window

0
prosit
Asked:
prosit
1 Solution
 
aikimarkCommented:
Try
WHERE [Payer Claim Number] Is Null

Open in new window

0
 
prositAuthor Commented:
I had tried "= Null"...

"IS NULL" was the difference...  ugh...

thanks

~j
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now