Solved

Update Excel Spreadsheet where value is blank not working

Posted on 2013-05-28
2
240 Views
Last Modified: 2013-05-29
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
Comment
Question by:prosit
2 Comments
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 39204622
Try
WHERE [Payer Claim Number] Is Null

Open in new window

0
 
LVL 2

Author Closing Comment

by:prosit
ID: 39204668
I had tried "= Null"...

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

thanks

~j
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RLDC Reporting in Visual studio 11 31
Help with preventing selection from a combobox 11 35
Very Large data in MYSQL 7 75
VB.net Open video relating to control 2 20
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question